diff --git a/README.md b/README.md index fba7f6f..fc2fa0d 100644 --- a/README.md +++ b/README.md @@ -94,9 +94,9 @@ Class | Method | HTTP request | Description *AgentApi* | [**AgentFetchLogs**](docs/AgentApi.md#agentfetchlogs) | **Post** /Agents/{id}/FetchLogs | Schedules a job on the agent to retrieve log files *AgentApi* | [**AgentGetAgentDetail**](docs/AgentApi.md#agentgetagentdetail) | **Get** /Agents/{id} | Returns details for a single agent, specified by ID *AgentApi* | [**AgentGetAgents**](docs/AgentApi.md#agentgetagents) | **Get** /Agents | Returns all agents according to the provided filter and output parameters -*AgentApi* | [**AgentReset0**](docs/AgentApi.md#agentreset0) | **Post** /Agents/Reset | Reset a list of agents -*AgentApi* | [**AgentReset1**](docs/AgentApi.md#agentreset1) | **Post** /Agents/{id}/Reset | Reset an agent to a new state +*AgentApi* | [**AgentReset**](docs/AgentApi.md#agentreset) | **Post** /Agents/{id}/Reset | Reset an agent to a new state *AgentApi* | [**AgentSetAuthCertificateReenrollment**](docs/AgentApi.md#agentsetauthcertificatereenrollment) | **Post** /Agents/SetAuthCertificateReenrollment | Update the AuthCertificateReenrollment value for an agent to request or require (or unset the request) the agent to enroll for a new client authentication certificate on its next registration. +*AgentApi* | [**AgentsReset**](docs/AgentApi.md#agentsreset) | **Post** /Agents/Reset | Reset a list of agents *AgentBlueprintApi* | [**AgentBlueprintApplyBlueprint**](docs/AgentBlueprintApi.md#agentblueprintapplyblueprint) | **Post** /AgentBluePrint/ApplyBlueprint | Applies the selected agent blueprint to the provided agents *AgentBlueprintApi* | [**AgentBlueprintDeleteBlueprint**](docs/AgentBlueprintApi.md#agentblueprintdeleteblueprint) | **Delete** /AgentBluePrint/{id} | Deletes an agent blueprint by its Keyfactor identifier *AgentBlueprintApi* | [**AgentBlueprintGenerateBlueprint**](docs/AgentBlueprintApi.md#agentblueprintgenerateblueprint) | **Post** /AgentBluePrint/GenerateBluePrint | Generates an agent blueprint from the provided agents diff --git a/api/command/api_agent.go b/api/command/api_agent.go index 0924a73..e37440c 100644 --- a/api/command/api_agent.go +++ b/api/command/api_agent.go @@ -88,9 +88,12 @@ func (a *AgentApiService) AgentApproveExecute(r ApiAgentApproveRequest) (*http.R formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Agents/Approve" + localVarPath := apiBasePath + "/Agents/Approve" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -208,9 +211,12 @@ func (a *AgentApiService) AgentDisapproveExecute(r ApiAgentDisapproveRequest) (* formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Agents/Disapprove" + localVarPath := apiBasePath + "/Agents/Disapprove" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -324,9 +330,12 @@ func (a *AgentApiService) AgentFetchLogsExecute(r ApiAgentFetchLogsRequest) (*ht formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Agents/{id}/FetchLogs" + localVarPath := apiBasePath + "/Agents/{id}/FetchLogs" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -439,9 +448,12 @@ func (a *AgentApiService) AgentGetAgentDetailExecute(r ApiAgentGetAgentDetailReq localVarReturnValue *KeyfactorApiModelsOrchestratorsAgentResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Agents/{id}" + localVarPath := apiBasePath + "/Agents/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -595,9 +607,12 @@ func (a *AgentApiService) AgentGetAgentsExecute(r ApiAgentGetAgentsRequest) ([]K localVarReturnValue []KeyfactorApiModelsOrchestratorsAgentResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Agents" + localVarPath := apiBasePath + "/Agents" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -679,64 +694,64 @@ func (a *AgentApiService) AgentGetAgentsExecute(r ApiAgentGetAgentsRequest) ([]K return localVarReturnValue, localVarHTTPResponse, nil } -type ApiAgentReset0Request struct { +type ApiAgentResetRequest struct { ctx context.Context ApiService *AgentApiService + id string xKeyfactorRequestedWith *string - agentIds *[]string xKeyfactorApiVersion *string } // Type of the request [XMLHttpRequest, APIClient] -func (r ApiAgentReset0Request) XKeyfactorRequestedWith(xKeyfactorRequestedWith string) ApiAgentReset0Request { +func (r ApiAgentResetRequest) XKeyfactorRequestedWith(xKeyfactorRequestedWith string) ApiAgentResetRequest { r.xKeyfactorRequestedWith = &xKeyfactorRequestedWith return r } -// List of Agent Ids to Reset -func (r ApiAgentReset0Request) AgentIds(agentIds []string) ApiAgentReset0Request { - r.agentIds = &agentIds - return r -} - // Desired version of the api, if not provided defaults to v1 -func (r ApiAgentReset0Request) XKeyfactorApiVersion(xKeyfactorApiVersion string) ApiAgentReset0Request { +func (r ApiAgentResetRequest) XKeyfactorApiVersion(xKeyfactorApiVersion string) ApiAgentResetRequest { r.xKeyfactorApiVersion = &xKeyfactorApiVersion return r } -func (r ApiAgentReset0Request) Execute() (*http.Response, error) { - return r.ApiService.AgentReset0Execute(r) +func (r ApiAgentResetRequest) Execute() (*http.Response, error) { + return r.ApiService.AgentResetExecute(r) } /* -AgentReset0 Reset a list of agents +AgentReset Reset an agent to a new state @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiAgentReset0Request + @param id Guid Id of Agent to reset + @return ApiAgentResetRequest */ -func (a *AgentApiService) AgentReset0(ctx context.Context) ApiAgentReset0Request { +func (a *AgentApiService) AgentReset(ctx context.Context, id string) ApiAgentResetRequest { requestedWith := "APIClient" version := "1" - return ApiAgentReset0Request{ + return ApiAgentResetRequest{ ApiService: a, ctx: ctx, xKeyfactorRequestedWith: &requestedWith, xKeyfactorApiVersion: &version, + id: id, } } // Execute executes the request -func (a *AgentApiService) AgentReset0Execute(r ApiAgentReset0Request) (*http.Response, error) { +func (a *AgentApiService) AgentResetExecute(r ApiAgentResetRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Agents/Reset" + localVarPath := apiBasePath + "/Agents/{id}/Reset" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -744,12 +759,9 @@ func (a *AgentApiService) AgentReset0Execute(r ApiAgentReset0Request) (*http.Res if r.xKeyfactorRequestedWith == nil { return nil, reportError("xKeyfactorRequestedWith is required and must be specified") } - if r.agentIds == nil { - return nil, reportError("agentIds is required and must be specified") - } // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -769,8 +781,6 @@ func (a *AgentApiService) AgentReset0Execute(r ApiAgentReset0Request) (*http.Res parameterAddToQuery(localVarHeaderParams, "x-keyfactor-api-version", r.xKeyfactorApiVersion, "") } parameterAddToQuery(localVarHeaderParams, "x-keyfactor-requested-with", r.xKeyfactorRequestedWith, "") - // body params - localVarPostBody = r.agentIds req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err @@ -799,71 +809,83 @@ func (a *AgentApiService) AgentReset0Execute(r ApiAgentReset0Request) (*http.Res return localVarHTTPResponse, nil } -type ApiAgentReset1Request struct { - ctx context.Context - ApiService *AgentApiService - id string - xKeyfactorRequestedWith *string - xKeyfactorApiVersion *string +type ApiAgentSetAuthCertificateReenrollmentRequest struct { + ctx context.Context + ApiService *AgentApiService + xKeyfactorRequestedWith *string + authCertReenrollmentRequest *KeyfactorApiModelsOrchestratorsUpdateOrchestratorAuthCertificateReenrollmentRequest + xKeyfactorApiVersion *string } // Type of the request [XMLHttpRequest, APIClient] -func (r ApiAgentReset1Request) XKeyfactorRequestedWith(xKeyfactorRequestedWith string) ApiAgentReset1Request { +func (r ApiAgentSetAuthCertificateReenrollmentRequest) XKeyfactorRequestedWith(xKeyfactorRequestedWith string) ApiAgentSetAuthCertificateReenrollmentRequest { r.xKeyfactorRequestedWith = &xKeyfactorRequestedWith return r } +// Object containing orchestrator ids and the new status those orchestrators should have +func (r ApiAgentSetAuthCertificateReenrollmentRequest) AuthCertReenrollmentRequest(authCertReenrollmentRequest KeyfactorApiModelsOrchestratorsUpdateOrchestratorAuthCertificateReenrollmentRequest) ApiAgentSetAuthCertificateReenrollmentRequest { + r.authCertReenrollmentRequest = &authCertReenrollmentRequest + return r +} + // Desired version of the api, if not provided defaults to v1 -func (r ApiAgentReset1Request) XKeyfactorApiVersion(xKeyfactorApiVersion string) ApiAgentReset1Request { +func (r ApiAgentSetAuthCertificateReenrollmentRequest) XKeyfactorApiVersion(xKeyfactorApiVersion string) ApiAgentSetAuthCertificateReenrollmentRequest { r.xKeyfactorApiVersion = &xKeyfactorApiVersion return r } -func (r ApiAgentReset1Request) Execute() (*http.Response, error) { - return r.ApiService.AgentReset1Execute(r) +func (r ApiAgentSetAuthCertificateReenrollmentRequest) Execute() (*KeyfactorApiModelsOrchestratorsUpdateOrchestratorAuthCertificateReenrollmentResponse, *http.Response, error) { + return r.ApiService.AgentSetAuthCertificateReenrollmentExecute(r) } /* -AgentReset1 Reset an agent to a new state +AgentSetAuthCertificateReenrollment Update the AuthCertificateReenrollment value for an agent to request or require (or unset the request) the agent to enroll for a new client authentication certificate on its next registration. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param id Guid Id of Agent to reset - @return ApiAgentReset1Request + @return ApiAgentSetAuthCertificateReenrollmentRequest */ -func (a *AgentApiService) AgentReset1(ctx context.Context, id string) ApiAgentReset1Request { +func (a *AgentApiService) AgentSetAuthCertificateReenrollment(ctx context.Context) ApiAgentSetAuthCertificateReenrollmentRequest { requestedWith := "APIClient" version := "1" - return ApiAgentReset1Request{ + return ApiAgentSetAuthCertificateReenrollmentRequest{ ApiService: a, ctx: ctx, xKeyfactorRequestedWith: &requestedWith, xKeyfactorApiVersion: &version, - id: id, } } // Execute executes the request -func (a *AgentApiService) AgentReset1Execute(r ApiAgentReset1Request) (*http.Response, error) { +// +// @return KeyfactorApiModelsOrchestratorsUpdateOrchestratorAuthCertificateReenrollmentResponse +func (a *AgentApiService) AgentSetAuthCertificateReenrollmentExecute(r ApiAgentSetAuthCertificateReenrollmentRequest) (*KeyfactorApiModelsOrchestratorsUpdateOrchestratorAuthCertificateReenrollmentResponse, *http.Response, error) { var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *KeyfactorApiModelsOrchestratorsUpdateOrchestratorAuthCertificateReenrollmentResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Agents/{id}/Reset" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + localVarPath := apiBasePath + "/Agents/SetAuthCertificateReenrollment" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} if r.xKeyfactorRequestedWith == nil { - return nil, reportError("xKeyfactorRequestedWith is required and must be specified") + return localVarReturnValue, nil, reportError("xKeyfactorRequestedWith is required and must be specified") + } + if r.authCertReenrollmentRequest == nil { + return localVarReturnValue, nil, reportError("authCertReenrollmentRequest is required and must be specified") } // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -872,7 +894,7 @@ func (a *AgentApiService) AgentReset1Execute(r ApiAgentReset1Request) (*http.Res } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) @@ -883,21 +905,23 @@ func (a *AgentApiService) AgentReset1Execute(r ApiAgentReset1Request) (*http.Res parameterAddToQuery(localVarHeaderParams, "x-keyfactor-api-version", r.xKeyfactorApiVersion, "") } parameterAddToQuery(localVarHeaderParams, "x-keyfactor-requested-with", r.xKeyfactorRequestedWith, "") + // body params + localVarPostBody = r.authCertReenrollmentRequest req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { - return nil, err + return localVarReturnValue, nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { @@ -905,52 +929,61 @@ func (a *AgentApiService) AgentReset1Execute(r ApiAgentReset1Request) (*http.Res body: localVarBody, error: localVarHTTPResponse.Status, } - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + 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 ApiAgentSetAuthCertificateReenrollmentRequest struct { - ctx context.Context - ApiService *AgentApiService - xKeyfactorRequestedWith *string - authCertReenrollmentRequest *KeyfactorApiModelsOrchestratorsUpdateOrchestratorAuthCertificateReenrollmentRequest - xKeyfactorApiVersion *string +type ApiAgentsResetRequest struct { + ctx context.Context + ApiService *AgentApiService + xKeyfactorRequestedWith *string + agentIds *[]string + xKeyfactorApiVersion *string } // Type of the request [XMLHttpRequest, APIClient] -func (r ApiAgentSetAuthCertificateReenrollmentRequest) XKeyfactorRequestedWith(xKeyfactorRequestedWith string) ApiAgentSetAuthCertificateReenrollmentRequest { +func (r ApiAgentsResetRequest) XKeyfactorRequestedWith(xKeyfactorRequestedWith string) ApiAgentsResetRequest { r.xKeyfactorRequestedWith = &xKeyfactorRequestedWith return r } -// Object containing orchestrator ids and the new status those orchestrators should have -func (r ApiAgentSetAuthCertificateReenrollmentRequest) AuthCertReenrollmentRequest(authCertReenrollmentRequest KeyfactorApiModelsOrchestratorsUpdateOrchestratorAuthCertificateReenrollmentRequest) ApiAgentSetAuthCertificateReenrollmentRequest { - r.authCertReenrollmentRequest = &authCertReenrollmentRequest +// List of Agent Ids to Reset +func (r ApiAgentsResetRequest) AgentIds(agentIds []string) ApiAgentsResetRequest { + r.agentIds = &agentIds return r } // Desired version of the api, if not provided defaults to v1 -func (r ApiAgentSetAuthCertificateReenrollmentRequest) XKeyfactorApiVersion(xKeyfactorApiVersion string) ApiAgentSetAuthCertificateReenrollmentRequest { +func (r ApiAgentsResetRequest) XKeyfactorApiVersion(xKeyfactorApiVersion string) ApiAgentsResetRequest { r.xKeyfactorApiVersion = &xKeyfactorApiVersion return r } -func (r ApiAgentSetAuthCertificateReenrollmentRequest) Execute() (*KeyfactorApiModelsOrchestratorsUpdateOrchestratorAuthCertificateReenrollmentResponse, *http.Response, error) { - return r.ApiService.AgentSetAuthCertificateReenrollmentExecute(r) +func (r ApiAgentsResetRequest) Execute() (*http.Response, error) { + return r.ApiService.AgentsResetExecute(r) } /* -AgentSetAuthCertificateReenrollment Update the AuthCertificateReenrollment value for an agent to request or require (or unset the request) the agent to enroll for a new client authentication certificate on its next registration. +AgentsReset Reset a list of agents @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiAgentSetAuthCertificateReenrollmentRequest + @return ApiAgentsResetRequest */ -func (a *AgentApiService) AgentSetAuthCertificateReenrollment(ctx context.Context) ApiAgentSetAuthCertificateReenrollmentRequest { +func (a *AgentApiService) AgentsReset(ctx context.Context) ApiAgentsResetRequest { requestedWith := "APIClient" version := "1" - return ApiAgentSetAuthCertificateReenrollmentRequest{ + return ApiAgentsResetRequest{ ApiService: a, ctx: ctx, xKeyfactorRequestedWith: &requestedWith, @@ -959,28 +992,28 @@ func (a *AgentApiService) AgentSetAuthCertificateReenrollment(ctx context.Contex } // Execute executes the request -// -// @return KeyfactorApiModelsOrchestratorsUpdateOrchestratorAuthCertificateReenrollmentResponse -func (a *AgentApiService) AgentSetAuthCertificateReenrollmentExecute(r ApiAgentSetAuthCertificateReenrollmentRequest) (*KeyfactorApiModelsOrchestratorsUpdateOrchestratorAuthCertificateReenrollmentResponse, *http.Response, error) { +func (a *AgentApiService) AgentsResetExecute(r ApiAgentsResetRequest) (*http.Response, error) { var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *KeyfactorApiModelsOrchestratorsUpdateOrchestratorAuthCertificateReenrollmentResponse + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Agents/SetAuthCertificateReenrollment" + localVarPath := apiBasePath + "/Agents/Reset" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} if r.xKeyfactorRequestedWith == nil { - return localVarReturnValue, nil, reportError("xKeyfactorRequestedWith is required and must be specified") + return nil, reportError("xKeyfactorRequestedWith is required and must be specified") } - if r.authCertReenrollmentRequest == nil { - return localVarReturnValue, nil, reportError("authCertReenrollmentRequest is required and must be specified") + if r.agentIds == nil { + return nil, reportError("agentIds is required and must be specified") } // to determine the Content-Type header @@ -993,7 +1026,7 @@ func (a *AgentApiService) AgentSetAuthCertificateReenrollmentExecute(r ApiAgentS } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} + localVarHTTPHeaderAccepts := []string{} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) @@ -1005,22 +1038,22 @@ func (a *AgentApiService) AgentSetAuthCertificateReenrollmentExecute(r ApiAgentS } parameterAddToQuery(localVarHeaderParams, "x-keyfactor-requested-with", r.xKeyfactorRequestedWith, "") // body params - localVarPostBody = r.authCertReenrollmentRequest + localVarPostBody = r.agentIds req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { - return localVarReturnValue, nil, err + return nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + return localVarHTTPResponse, err } localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { @@ -1028,17 +1061,8 @@ func (a *AgentApiService) AgentSetAuthCertificateReenrollmentExecute(r ApiAgentS 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 localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarHTTPResponse, nil } diff --git a/api/command/api_agent_blueprint.go b/api/command/api_agent_blueprint.go index 4f4ab6e..aa15222 100644 --- a/api/command/api_agent_blueprint.go +++ b/api/command/api_agent_blueprint.go @@ -95,9 +95,12 @@ func (a *AgentBlueprintApiService) AgentBlueprintApplyBlueprintExecute(r ApiAgen formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/AgentBluePrint/ApplyBlueprint" + localVarPath := apiBasePath + "/AgentBluePrint/ApplyBlueprint" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -215,9 +218,12 @@ func (a *AgentBlueprintApiService) AgentBlueprintDeleteBlueprintExecute(r ApiAge formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/AgentBluePrint/{id}" + localVarPath := apiBasePath + "/AgentBluePrint/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -341,9 +347,12 @@ func (a *AgentBlueprintApiService) AgentBlueprintGenerateBlueprintExecute(r ApiA localVarReturnValue *KeyfactorApiModelsOrchestratorsAgentBlueprintResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/AgentBluePrint/GenerateBluePrint" + localVarPath := apiBasePath + "/AgentBluePrint/GenerateBluePrint" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -472,9 +481,12 @@ func (a *AgentBlueprintApiService) AgentBlueprintGetAgentBlueprintExecute(r ApiA localVarReturnValue *KeyfactorApiModelsOrchestratorsAgentBlueprintResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/AgentBluePrint/{id}" + localVarPath := apiBasePath + "/AgentBluePrint/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -621,9 +633,12 @@ func (a *AgentBlueprintApiService) AgentBlueprintGetAgentBlueprintsExecute(r Api localVarReturnValue []KeyfactorApiModelsOrchestratorsAgentBlueprintResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/AgentBluePrint" + localVarPath := apiBasePath + "/AgentBluePrint" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -784,9 +799,12 @@ func (a *AgentBlueprintApiService) AgentBlueprintGetBlueprintJobsExecute(r ApiAg localVarReturnValue []KeyfactorApiModelsOrchestratorsAgentBlueprintJobsResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/AgentBluePrint/{id}/Jobs" + localVarPath := apiBasePath + "/AgentBluePrint/{id}/Jobs" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -948,9 +966,12 @@ func (a *AgentBlueprintApiService) AgentBlueprintGetBlueprintStoresExecute(r Api localVarReturnValue []KeyfactorApiModelsOrchestratorsAgentBlueprintStoresResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/AgentBluePrint/{id}/Stores" + localVarPath := apiBasePath + "/AgentBluePrint/{id}/Stores" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) diff --git a/api/command/api_agent_blueprint_test.go b/api/command/api_agent_blueprint_test.go index 7bc2119..863c347 100644 --- a/api/command/api_agent_blueprint_test.go +++ b/api/command/api_agent_blueprint_test.go @@ -23,10 +23,13 @@ import ( "context" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "os" "testing" ) func Test_command_AgentBlueprintApiService(t *testing.T) { + cwd, _ := os.Getwd() + t.Logf("Working directory: %s", cwd) config := GetEnvConfiguration() configuration, configErr := NewConfiguration(config) @@ -45,9 +48,13 @@ func Test_command_AgentBlueprintApiService(t *testing.T) { t.Run("Test AgentBlueprintApiService AgentBlueprintDeleteBlueprint", func(t *testing.T) { - var id string + var id interface{} - httpRes, err := apiClient.AgentBlueprintApi.AgentBlueprintDeleteBlueprint(context.Background(), id).Execute() + id = os.Getenv("AgentBlueprintApi_AgentBlueprintDeleteBlueprint_id") + id, _ = convertParamInterface(id, "string") + t.Logf("AgentBlueprintApi_AgentBlueprintDeleteBlueprint_id: %v", id) + + httpRes, err := apiClient.AgentBlueprintApi.AgentBlueprintDeleteBlueprint(context.Background(), id.(string)).Execute() require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) @@ -66,9 +73,13 @@ func Test_command_AgentBlueprintApiService(t *testing.T) { t.Run("Test AgentBlueprintApiService AgentBlueprintGetAgentBlueprint", func(t *testing.T) { - var id string + var id interface{} + + id = os.Getenv("AgentBlueprintApi_AgentBlueprintGetAgentBlueprint_id") + id, _ = convertParamInterface(id, "string") + t.Logf("AgentBlueprintApi_AgentBlueprintGetAgentBlueprint_id: %v", id) - resp, httpRes, err := apiClient.AgentBlueprintApi.AgentBlueprintGetAgentBlueprint(context.Background(), id).Execute() + resp, httpRes, err := apiClient.AgentBlueprintApi.AgentBlueprintGetAgentBlueprint(context.Background(), id.(string)).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -88,9 +99,13 @@ func Test_command_AgentBlueprintApiService(t *testing.T) { t.Run("Test AgentBlueprintApiService AgentBlueprintGetBlueprintJobs", func(t *testing.T) { - var id string + var id interface{} - resp, httpRes, err := apiClient.AgentBlueprintApi.AgentBlueprintGetBlueprintJobs(context.Background(), id).Execute() + id = os.Getenv("AgentBlueprintApi_AgentBlueprintGetBlueprintJobs_id") + id, _ = convertParamInterface(id, "string") + t.Logf("AgentBlueprintApi_AgentBlueprintGetBlueprintJobs_id: %v", id) + + resp, httpRes, err := apiClient.AgentBlueprintApi.AgentBlueprintGetBlueprintJobs(context.Background(), id.(string)).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -100,9 +115,13 @@ func Test_command_AgentBlueprintApiService(t *testing.T) { t.Run("Test AgentBlueprintApiService AgentBlueprintGetBlueprintStores", func(t *testing.T) { - var id string + var id interface{} + + id = os.Getenv("AgentBlueprintApi_AgentBlueprintGetBlueprintStores_id") + id, _ = convertParamInterface(id, "string") + t.Logf("AgentBlueprintApi_AgentBlueprintGetBlueprintStores_id: %v", id) - resp, httpRes, err := apiClient.AgentBlueprintApi.AgentBlueprintGetBlueprintStores(context.Background(), id).Execute() + resp, httpRes, err := apiClient.AgentBlueprintApi.AgentBlueprintGetBlueprintStores(context.Background(), id.(string)).Execute() require.Nil(t, err) require.NotNil(t, resp) diff --git a/api/command/api_agent_pool.go b/api/command/api_agent_pool.go index 05116b0..6bf88ac 100644 --- a/api/command/api_agent_pool.go +++ b/api/command/api_agent_pool.go @@ -94,9 +94,12 @@ func (a *AgentPoolApiService) AgentPoolCreateAgentPoolExecute(r ApiAgentPoolCrea localVarReturnValue *ModelsAgentsAgentPool ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/AgentPools" + localVarPath := apiBasePath + "/AgentPools" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -219,9 +222,12 @@ func (a *AgentPoolApiService) AgentPoolDeleteAgentPoolExecute(r ApiAgentPoolDele formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/AgentPools/{id}" + localVarPath := apiBasePath + "/AgentPools/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -334,9 +340,12 @@ func (a *AgentPoolApiService) AgentPoolGetAgentPoolByIdExecute(r ApiAgentPoolGet localVarReturnValue *ModelsAgentsAgentPool ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/AgentPools/{id}" + localVarPath := apiBasePath + "/AgentPools/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -490,9 +499,12 @@ func (a *AgentPoolApiService) AgentPoolGetAgentPoolsExecute(r ApiAgentPoolGetAge localVarReturnValue []ModelsAgentsAgentPool ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/AgentPools" + localVarPath := apiBasePath + "/AgentPools" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -660,9 +672,12 @@ func (a *AgentPoolApiService) AgentPoolGetDefaultAgentPoolAgentsExecute(r ApiAge localVarReturnValue []ModelsAgentsAgentPoolAgent ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/AgentPools/Agents" + localVarPath := apiBasePath + "/AgentPools/Agents" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -805,9 +820,12 @@ func (a *AgentPoolApiService) AgentPoolUpdateAgentPoolExecute(r ApiAgentPoolUpda localVarReturnValue *ModelsAgentsAgentPool ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/AgentPools" + localVarPath := apiBasePath + "/AgentPools" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} diff --git a/api/command/api_agent_pool_test.go b/api/command/api_agent_pool_test.go index 37c829a..0514bfd 100644 --- a/api/command/api_agent_pool_test.go +++ b/api/command/api_agent_pool_test.go @@ -23,10 +23,13 @@ import ( "context" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "os" "testing" ) func Test_command_AgentPoolApiService(t *testing.T) { + cwd, _ := os.Getwd() + t.Logf("Working directory: %s", cwd) config := GetEnvConfiguration() configuration, configErr := NewConfiguration(config) @@ -46,9 +49,13 @@ func Test_command_AgentPoolApiService(t *testing.T) { t.Run("Test AgentPoolApiService AgentPoolDeleteAgentPool", func(t *testing.T) { - var id string + var id interface{} - httpRes, err := apiClient.AgentPoolApi.AgentPoolDeleteAgentPool(context.Background(), id).Execute() + id = os.Getenv("AgentPoolApi_AgentPoolDeleteAgentPool_id") + id, _ = convertParamInterface(id, "string") + t.Logf("AgentPoolApi_AgentPoolDeleteAgentPool_id: %v", id) + + httpRes, err := apiClient.AgentPoolApi.AgentPoolDeleteAgentPool(context.Background(), id.(string)).Execute() require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) @@ -57,9 +64,13 @@ func Test_command_AgentPoolApiService(t *testing.T) { t.Run("Test AgentPoolApiService AgentPoolGetAgentPoolById", func(t *testing.T) { - var id string + var id interface{} + + id = os.Getenv("AgentPoolApi_AgentPoolGetAgentPoolById_id") + id, _ = convertParamInterface(id, "string") + t.Logf("AgentPoolApi_AgentPoolGetAgentPoolById_id: %v", id) - resp, httpRes, err := apiClient.AgentPoolApi.AgentPoolGetAgentPoolById(context.Background(), id).Execute() + resp, httpRes, err := apiClient.AgentPoolApi.AgentPoolGetAgentPoolById(context.Background(), id.(string)).Execute() require.Nil(t, err) require.NotNil(t, resp) diff --git a/api/command/api_agent_test.go b/api/command/api_agent_test.go index 8bc8711..6bee4c9 100644 --- a/api/command/api_agent_test.go +++ b/api/command/api_agent_test.go @@ -23,10 +23,13 @@ import ( "context" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "os" "testing" ) func Test_command_AgentApiService(t *testing.T) { + cwd, _ := os.Getwd() + t.Logf("Working directory: %s", cwd) config := GetEnvConfiguration() configuration, configErr := NewConfiguration(config) @@ -54,9 +57,13 @@ func Test_command_AgentApiService(t *testing.T) { t.Run("Test AgentApiService AgentFetchLogs", func(t *testing.T) { - var id string + var id interface{} - httpRes, err := apiClient.AgentApi.AgentFetchLogs(context.Background(), id).Execute() + id = os.Getenv("AgentApi_AgentFetchLogs_id") + id, _ = convertParamInterface(id, "string") + t.Logf("AgentApi_AgentFetchLogs_id: %v", id) + + httpRes, err := apiClient.AgentApi.AgentFetchLogs(context.Background(), id.(string)).Execute() require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) @@ -65,9 +72,13 @@ func Test_command_AgentApiService(t *testing.T) { t.Run("Test AgentApiService AgentGetAgentDetail", func(t *testing.T) { - var id string + var id interface{} + + id = os.Getenv("AgentApi_AgentGetAgentDetail_id") + id, _ = convertParamInterface(id, "string") + t.Logf("AgentApi_AgentGetAgentDetail_id: %v", id) - resp, httpRes, err := apiClient.AgentApi.AgentGetAgentDetail(context.Background(), id).Execute() + resp, httpRes, err := apiClient.AgentApi.AgentGetAgentDetail(context.Background(), id.(string)).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -85,32 +96,36 @@ func Test_command_AgentApiService(t *testing.T) { }) - t.Run("Test AgentApiService AgentReset0", func(t *testing.T) { + t.Run("Test AgentApiService AgentReset", func(t *testing.T) { + + var id interface{} - httpRes, err := apiClient.AgentApi.AgentReset0(context.Background()).Execute() + id = os.Getenv("AgentApi_AgentReset_id") + id, _ = convertParamInterface(id, "string") + t.Logf("AgentApi_AgentReset_id: %v", id) + + httpRes, err := apiClient.AgentApi.AgentReset(context.Background(), id.(string)).Execute() require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) }) - t.Run("Test AgentApiService AgentReset1", func(t *testing.T) { - - var id string + t.Run("Test AgentApiService AgentSetAuthCertificateReenrollment", func(t *testing.T) { - httpRes, err := apiClient.AgentApi.AgentReset1(context.Background(), id).Execute() + resp, httpRes, err := apiClient.AgentApi.AgentSetAuthCertificateReenrollment(context.Background()).Execute() require.Nil(t, err) + require.NotNil(t, resp) assert.Equal(t, 200, httpRes.StatusCode) }) - t.Run("Test AgentApiService AgentSetAuthCertificateReenrollment", func(t *testing.T) { + t.Run("Test AgentApiService AgentsReset", func(t *testing.T) { - resp, httpRes, err := apiClient.AgentApi.AgentSetAuthCertificateReenrollment(context.Background()).Execute() + httpRes, err := apiClient.AgentApi.AgentsReset(context.Background()).Execute() require.Nil(t, err) - require.NotNil(t, resp) assert.Equal(t, 200, httpRes.StatusCode) }) diff --git a/api/command/api_audit_log.go b/api/command/api_audit_log.go index 0c04ed0..15cb8df 100644 --- a/api/command/api_audit_log.go +++ b/api/command/api_audit_log.go @@ -119,9 +119,12 @@ func (a *AuditLogApiService) AuditLogDownloadCSVExecute(r ApiAuditLogDownloadCSV localVarReturnValue string ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Audit/Download" + localVarPath := apiBasePath + "/Audit/Download" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -257,9 +260,12 @@ func (a *AuditLogApiService) AuditLogGetAuditLogExecute(r ApiAuditLogGetAuditLog localVarReturnValue map[string]interface{} ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Audit/{id}" + localVarPath := apiBasePath + "/Audit/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -413,9 +419,12 @@ func (a *AuditLogApiService) AuditLogGetAuditLogsExecute(r ApiAuditLogGetAuditLo localVarReturnValue []KeyfactorAuditingQueryingAuditLogEntry ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Audit" + localVarPath := apiBasePath + "/Audit" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -583,9 +592,12 @@ func (a *AuditLogApiService) AuditLogGetRelatedEntitiesExecute(r ApiAuditLogGetR localVarReturnValue []KeyfactorAuditingQueryingAuditLogEntry ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Audit/RelatedEntities" + localVarPath := apiBasePath + "/Audit/RelatedEntities" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -723,9 +735,12 @@ func (a *AuditLogApiService) AuditLogValidateAuditLogExecute(r ApiAuditLogValida localVarReturnValue bool ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Audit/{id}/Validate" + localVarPath := apiBasePath + "/Audit/{id}/Validate" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) diff --git a/api/command/api_audit_log_test.go b/api/command/api_audit_log_test.go index 3de138f..5ea09e4 100644 --- a/api/command/api_audit_log_test.go +++ b/api/command/api_audit_log_test.go @@ -23,10 +23,13 @@ import ( "context" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "os" "testing" ) func Test_command_AuditLogApiService(t *testing.T) { + cwd, _ := os.Getwd() + t.Logf("Working directory: %s", cwd) config := GetEnvConfiguration() configuration, configErr := NewConfiguration(config) @@ -46,9 +49,13 @@ func Test_command_AuditLogApiService(t *testing.T) { t.Run("Test AuditLogApiService AuditLogGetAuditLog", func(t *testing.T) { - var id int32 + var id interface{} - resp, httpRes, err := apiClient.AuditLogApi.AuditLogGetAuditLog(context.Background(), id).Execute() + id = os.Getenv("AuditLogApi_AuditLogGetAuditLog_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("AuditLogApi_AuditLogGetAuditLog_id: %v", id) + + resp, httpRes, err := apiClient.AuditLogApi.AuditLogGetAuditLog(context.Background(), id.(int32)).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -78,9 +85,13 @@ func Test_command_AuditLogApiService(t *testing.T) { t.Run("Test AuditLogApiService AuditLogValidateAuditLog", func(t *testing.T) { - var id int32 + var id interface{} + + id = os.Getenv("AuditLogApi_AuditLogValidateAuditLog_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("AuditLogApi_AuditLogValidateAuditLog_id: %v", id) - resp, httpRes, err := apiClient.AuditLogApi.AuditLogValidateAuditLog(context.Background(), id).Execute() + resp, httpRes, err := apiClient.AuditLogApi.AuditLogValidateAuditLog(context.Background(), id.(int32)).Execute() require.Nil(t, err) require.NotNil(t, resp) diff --git a/api/command/api_certificate.go b/api/command/api_certificate.go index c039522..21b089e 100644 --- a/api/command/api_certificate.go +++ b/api/command/api_certificate.go @@ -91,9 +91,12 @@ func (a *CertificateApiService) CertificateAnalyzeCertExecute(r ApiCertificateAn localVarReturnValue []ModelsCertificateDetails ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Certificates/Analyze" + localVarPath := apiBasePath + "/Certificates/Analyze" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -254,9 +257,12 @@ func (a *CertificateApiService) CertificateCertificateHistoryExecute(r ApiCertif localVarReturnValue []ModelsPKICertificateOperation ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Certificates/{id}/History" + localVarPath := apiBasePath + "/Certificates/{id}/History" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -418,9 +424,12 @@ func (a *CertificateApiService) CertificateCompareMetadataExecute(r ApiCertifica localVarReturnValue bool ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Certificates/Metadata/Compare" + localVarPath := apiBasePath + "/Certificates/Metadata/Compare" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -566,9 +575,12 @@ func (a *CertificateApiService) CertificateDeleteByQueryExecute(r ApiCertificate formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Certificates/Query" + localVarPath := apiBasePath + "/Certificates/Query" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -692,9 +704,12 @@ func (a *CertificateApiService) CertificateDeleteCertificateExecute(r ApiCertifi formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Certificates/{id}" + localVarPath := apiBasePath + "/Certificates/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -820,9 +835,12 @@ func (a *CertificateApiService) CertificateDeleteCertificatesExecute(r ApiCertif formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Certificates" + localVarPath := apiBasePath + "/Certificates" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -950,9 +968,12 @@ func (a *CertificateApiService) CertificateDeletePrivateKeys0Execute(r ApiCertif formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Certificates/PrivateKey" + localVarPath := apiBasePath + "/Certificates/PrivateKey" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1076,9 +1097,12 @@ func (a *CertificateApiService) CertificateDeletePrivateKeys1Execute(r ApiCertif formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Certificates/PrivateKey/{id}" + localVarPath := apiBasePath + "/Certificates/PrivateKey/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -1210,9 +1234,12 @@ func (a *CertificateApiService) CertificateDownloadCertificateAsyncExecute(r Api localVarReturnValue *ModelsCertificateDownloadResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Certificates/Download" + localVarPath := apiBasePath + "/Certificates/Download" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1368,9 +1395,12 @@ func (a *CertificateApiService) CertificateGetCertificateExecute(r ApiCertificat localVarReturnValue *ModelsCertificateRetrievalResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Certificates/{id}" + localVarPath := apiBasePath + "/Certificates/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -1511,9 +1541,12 @@ func (a *CertificateApiService) CertificateGetCertificateLocationsExecute(r ApiC localVarReturnValue *KeyfactorApiModelsCertificatesCertificateLocationsResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Certificates/Locations/{id}" + localVarPath := apiBasePath + "/Certificates/Locations/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -1645,9 +1678,12 @@ func (a *CertificateApiService) CertificateGetCertificateSecurityExecute(r ApiCe localVarReturnValue *ModelsSecurityCertificatePermissions ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Certificates/{id}/Security" + localVarPath := apiBasePath + "/Certificates/{id}/Security" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -1779,9 +1815,12 @@ func (a *CertificateApiService) CertificateIdentityAuditExecute(r ApiCertificate localVarReturnValue []KeyfactorApiModelsCertificatesCertificateIdentityAuditResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Certificates/IdentityAudit/{id}" + localVarPath := apiBasePath + "/Certificates/IdentityAudit/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -1910,9 +1949,12 @@ func (a *CertificateApiService) CertificatePostImportCertificateExecute(r ApiCer localVarReturnValue *ModelsCertificateImportResponseModel ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Certificates/Import" + localVarPath := apiBasePath + "/Certificates/Import" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2118,9 +2160,12 @@ func (a *CertificateApiService) CertificateQueryCertificatesExecute(r ApiCertifi localVarReturnValue []ModelsCertificateRetrievalResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Certificates" + localVarPath := apiBasePath + "/Certificates" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2300,9 +2345,12 @@ func (a *CertificateApiService) CertificateRecoverCertificateAsyncExecute(r ApiC localVarReturnValue *ModelsRecoveryResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Certificates/Recover" + localVarPath := apiBasePath + "/Certificates/Recover" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2453,9 +2501,12 @@ func (a *CertificateApiService) CertificateRevokeExecute(r ApiCertificateRevokeR localVarReturnValue *ModelsRevocationRevocationResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Certificates/Revoke" + localVarPath := apiBasePath + "/Certificates/Revoke" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2606,9 +2657,12 @@ func (a *CertificateApiService) CertificateRevokeAllExecute(r ApiCertificateRevo localVarReturnValue *ModelsRevocationRevocationResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Certificates/RevokeAll" + localVarPath := apiBasePath + "/Certificates/RevokeAll" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2745,9 +2799,12 @@ func (a *CertificateApiService) CertificateUpdateAllMetadataExecute(r ApiCertifi formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Certificates/Metadata/All" + localVarPath := apiBasePath + "/Certificates/Metadata/All" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2875,9 +2932,12 @@ func (a *CertificateApiService) CertificateUpdateMetadataExecute(r ApiCertificat formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Certificates/Metadata" + localVarPath := apiBasePath + "/Certificates/Metadata" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -3004,9 +3064,12 @@ func (a *CertificateApiService) CertificateValidateCertificateExecute(r ApiCerti localVarReturnValue *ModelsCertificateValidationResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Certificates/{id}/Validate" + localVarPath := apiBasePath + "/Certificates/{id}/Validate" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) diff --git a/api/command/api_certificate_authority.go b/api/command/api_certificate_authority.go index 3411f67..9ae5e1b 100644 --- a/api/command/api_certificate_authority.go +++ b/api/command/api_certificate_authority.go @@ -90,9 +90,12 @@ func (a *CertificateAuthorityApiService) CertificateAuthorityCreateCAExecute(r A localVarReturnValue *ModelsCertificateAuthoritiesCertificateAuthorityResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/CertificateAuthority" + localVarPath := apiBasePath + "/CertificateAuthority" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -215,9 +218,12 @@ func (a *CertificateAuthorityApiService) CertificateAuthorityDeleteCAExecute(r A formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/CertificateAuthority/{id}" + localVarPath := apiBasePath + "/CertificateAuthority/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -330,9 +336,12 @@ func (a *CertificateAuthorityApiService) CertificateAuthorityGetCaExecute(r ApiC localVarReturnValue *ModelsCertificateAuthoritiesCertificateAuthorityResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/CertificateAuthority/{id}" + localVarPath := apiBasePath + "/CertificateAuthority/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -486,9 +495,12 @@ func (a *CertificateAuthorityApiService) CertificateAuthorityGetCasExecute(r Api localVarReturnValue []ModelsCertificateAuthoritiesCertificateAuthorityResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/CertificateAuthority" + localVarPath := apiBasePath + "/CertificateAuthority" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -625,9 +637,12 @@ func (a *CertificateAuthorityApiService) CertificateAuthorityPublishCRLExecute(r formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/CertificateAuthority/PublishCRL" + localVarPath := apiBasePath + "/CertificateAuthority/PublishCRL" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -748,9 +763,12 @@ func (a *CertificateAuthorityApiService) CertificateAuthorityTestCertificateAuth localVarReturnValue *KeyfactorApiModelsCertificateAuthoritiesCertificateAuthorityTestResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/CertificateAuthority/Test" + localVarPath := apiBasePath + "/CertificateAuthority/Test" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -879,9 +897,12 @@ func (a *CertificateAuthorityApiService) CertificateAuthorityUpdateCAExecute(r A localVarReturnValue *ModelsCertificateAuthoritiesCertificateAuthorityResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/CertificateAuthority" + localVarPath := apiBasePath + "/CertificateAuthority" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} diff --git a/api/command/api_certificate_authority_test.go b/api/command/api_certificate_authority_test.go index c99afa0..037b7bd 100644 --- a/api/command/api_certificate_authority_test.go +++ b/api/command/api_certificate_authority_test.go @@ -23,10 +23,13 @@ import ( "context" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "os" "testing" ) func Test_command_CertificateAuthorityApiService(t *testing.T) { + cwd, _ := os.Getwd() + t.Logf("Working directory: %s", cwd) config := GetEnvConfiguration() configuration, configErr := NewConfiguration(config) @@ -46,9 +49,13 @@ func Test_command_CertificateAuthorityApiService(t *testing.T) { t.Run("Test CertificateAuthorityApiService CertificateAuthorityDeleteCA", func(t *testing.T) { - var id int32 + var id interface{} - httpRes, err := apiClient.CertificateAuthorityApi.CertificateAuthorityDeleteCA(context.Background(), id).Execute() + id = os.Getenv("CertificateAuthorityApi_CertificateAuthorityDeleteCA_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("CertificateAuthorityApi_CertificateAuthorityDeleteCA_id: %v", id) + + httpRes, err := apiClient.CertificateAuthorityApi.CertificateAuthorityDeleteCA(context.Background(), id.(int32)).Execute() require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) @@ -57,9 +64,13 @@ func Test_command_CertificateAuthorityApiService(t *testing.T) { t.Run("Test CertificateAuthorityApiService CertificateAuthorityGetCa", func(t *testing.T) { - var id int32 + var id interface{} + + id = os.Getenv("CertificateAuthorityApi_CertificateAuthorityGetCa_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("CertificateAuthorityApi_CertificateAuthorityGetCa_id: %v", id) - resp, httpRes, err := apiClient.CertificateAuthorityApi.CertificateAuthorityGetCa(context.Background(), id).Execute() + resp, httpRes, err := apiClient.CertificateAuthorityApi.CertificateAuthorityGetCa(context.Background(), id.(int32)).Execute() require.Nil(t, err) require.NotNil(t, resp) diff --git a/api/command/api_certificate_collection.go b/api/command/api_certificate_collection.go index 7de969f..e6fdc12 100644 --- a/api/command/api_certificate_collection.go +++ b/api/command/api_certificate_collection.go @@ -99,9 +99,12 @@ func (a *CertificateCollectionApiService) CertificateCollectionCopyFromExistingC localVarReturnValue *KeyfactorApiModelsCertificateCollectionsCertificateCollectionResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/CertificateCollections/Copy" + localVarPath := apiBasePath + "/CertificateCollections/Copy" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -239,9 +242,12 @@ func (a *CertificateCollectionApiService) CertificateCollectionCreateCollectionE localVarReturnValue *KeyfactorApiModelsCertificateCollectionsCertificateCollectionResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/CertificateCollections" + localVarPath := apiBasePath + "/CertificateCollections" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -367,9 +373,12 @@ func (a *CertificateCollectionApiService) CertificateCollectionGetCollection0Exe localVarReturnValue *ModelsCertificateQuery ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/CertificateCollections/{id}" + localVarPath := apiBasePath + "/CertificateCollections/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -491,9 +500,12 @@ func (a *CertificateCollectionApiService) CertificateCollectionGetCollection1Exe localVarReturnValue *ModelsCertificateQuery ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/CertificateCollections/{name}" + localVarPath := apiBasePath + "/CertificateCollections/{name}" localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", url.PathEscape(parameterValueToString(r.name, "name")), -1) localVarHeaderParams := make(map[string]string) @@ -647,9 +659,12 @@ func (a *CertificateCollectionApiService) CertificateCollectionGetCollectionsExe localVarReturnValue []ModelsCertificateQuery ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/CertificateCollections" + localVarPath := apiBasePath + "/CertificateCollections" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -794,9 +809,12 @@ func (a *CertificateCollectionApiService) CertificateCollectionSetCollectionPerm formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/CertificateCollections/{id}/Permissions" + localVarPath := apiBasePath + "/CertificateCollections/{id}/Permissions" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -926,9 +944,12 @@ func (a *CertificateCollectionApiService) CertificateCollectionUpdateCollectionE localVarReturnValue *KeyfactorApiModelsCertificateCollectionsCertificateCollectionResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/CertificateCollections" + localVarPath := apiBasePath + "/CertificateCollections" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} diff --git a/api/command/api_certificate_collection_test.go b/api/command/api_certificate_collection_test.go index c71aed8..61afaba 100644 --- a/api/command/api_certificate_collection_test.go +++ b/api/command/api_certificate_collection_test.go @@ -23,10 +23,13 @@ import ( "context" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "os" "testing" ) func Test_command_CertificateCollectionApiService(t *testing.T) { + cwd, _ := os.Getwd() + t.Logf("Working directory: %s", cwd) config := GetEnvConfiguration() configuration, configErr := NewConfiguration(config) @@ -56,9 +59,13 @@ func Test_command_CertificateCollectionApiService(t *testing.T) { t.Run("Test CertificateCollectionApiService CertificateCollectionGetCollection0", func(t *testing.T) { - var id int32 + var id interface{} - resp, httpRes, err := apiClient.CertificateCollectionApi.CertificateCollectionGetCollection0(context.Background(), id).Execute() + id = os.Getenv("CertificateCollectionApi_CertificateCollectionGetCollection0_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("CertificateCollectionApi_CertificateCollectionGetCollection0_id: %v", id) + + resp, httpRes, err := apiClient.CertificateCollectionApi.CertificateCollectionGetCollection0(context.Background(), id.(int32)).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -68,9 +75,13 @@ func Test_command_CertificateCollectionApiService(t *testing.T) { t.Run("Test CertificateCollectionApiService CertificateCollectionGetCollection1", func(t *testing.T) { - var name string + var name interface{} + + name = os.Getenv("CertificateCollectionApi_CertificateCollectionGetCollection1_name") + name, _ = convertParamInterface(name, "string") + t.Logf("CertificateCollectionApi_CertificateCollectionGetCollection1_name: %v", name) - resp, httpRes, err := apiClient.CertificateCollectionApi.CertificateCollectionGetCollection1(context.Background(), name).Execute() + resp, httpRes, err := apiClient.CertificateCollectionApi.CertificateCollectionGetCollection1(context.Background(), name.(string)).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -90,9 +101,13 @@ func Test_command_CertificateCollectionApiService(t *testing.T) { t.Run("Test CertificateCollectionApiService CertificateCollectionSetCollectionPermissions", func(t *testing.T) { - var id int32 + var id interface{} + + id = os.Getenv("CertificateCollectionApi_CertificateCollectionSetCollectionPermissions_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("CertificateCollectionApi_CertificateCollectionSetCollectionPermissions_id: %v", id) - httpRes, err := apiClient.CertificateCollectionApi.CertificateCollectionSetCollectionPermissions(context.Background(), id).Execute() + httpRes, err := apiClient.CertificateCollectionApi.CertificateCollectionSetCollectionPermissions(context.Background(), id.(int32)).Execute() require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) diff --git a/api/command/api_certificate_store.go b/api/command/api_certificate_store.go index 37401f5..bbfda5c 100644 --- a/api/command/api_certificate_store.go +++ b/api/command/api_certificate_store.go @@ -91,9 +91,12 @@ func (a *CertificateStoreApiService) CertificateStoreAddCertificateExecute(r Api localVarReturnValue []string ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/CertificateStores/Certificates/Add" + localVarPath := apiBasePath + "/CertificateStores/Certificates/Add" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -220,9 +223,12 @@ func (a *CertificateStoreApiService) CertificateStoreApprovePendingExecute(r Api formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/CertificateStores/Approve" + localVarPath := apiBasePath + "/CertificateStores/Approve" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -340,9 +346,12 @@ func (a *CertificateStoreApiService) CertificateStoreConfigureDiscoveryJobExecut formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/CertificateStores/DiscoveryJob" + localVarPath := apiBasePath + "/CertificateStores/DiscoveryJob" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -467,9 +476,12 @@ func (a *CertificateStoreApiService) CertificateStoreCreateCertificateStoreServe localVarReturnValue *ModelsCertificateStoreServerResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/CertificateStores/Server" + localVarPath := apiBasePath + "/CertificateStores/Server" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -592,9 +604,12 @@ func (a *CertificateStoreApiService) CertificateStoreDeleteCertificateStoreExecu formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/CertificateStores/{id}" + localVarPath := apiBasePath + "/CertificateStores/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -710,9 +725,12 @@ func (a *CertificateStoreApiService) CertificateStoreDeleteCertificateStoresExec formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/CertificateStores" + localVarPath := apiBasePath + "/CertificateStores" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -857,9 +875,12 @@ func (a *CertificateStoreApiService) CertificateStoreGetCertificateStoreInventor localVarReturnValue []ModelsCertificateStoreInventory ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/CertificateStores/{id}/Inventory" + localVarPath := apiBasePath + "/CertificateStores/{id}/Inventory" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -997,9 +1018,12 @@ func (a *CertificateStoreApiService) CertificateStoreRemoveCertificateExecute(r localVarReturnValue []string ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/CertificateStores/Certificates/Remove" + localVarPath := apiBasePath + "/CertificateStores/Certificates/Remove" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1126,9 +1150,12 @@ func (a *CertificateStoreApiService) CertificateStoreScheduleExecute(r ApiCertif formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/CertificateStores/Schedule" + localVarPath := apiBasePath + "/CertificateStores/Schedule" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1246,9 +1273,12 @@ func (a *CertificateStoreApiService) CertificateStoreScheduleForReenrollmentExec formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/CertificateStores/Reenrollment" + localVarPath := apiBasePath + "/CertificateStores/Reenrollment" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1366,9 +1396,12 @@ func (a *CertificateStoreApiService) CertificateStoreSetPasswordExecute(r ApiCer formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/CertificateStores/Password" + localVarPath := apiBasePath + "/CertificateStores/Password" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1493,9 +1526,12 @@ func (a *CertificateStoreApiService) CertificateStoreUpdateCertificateStoreServe localVarReturnValue *ModelsCertificateStoreServerResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/CertificateStores/Server" + localVarPath := apiBasePath + "/CertificateStores/Server" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} diff --git a/api/command/api_certificate_store_container.go b/api/command/api_certificate_store_container.go index 84cb6b8..c78f0bc 100644 --- a/api/command/api_certificate_store_container.go +++ b/api/command/api_certificate_store_container.go @@ -84,9 +84,12 @@ func (a *CertificateStoreContainerApiService) CertificateStoreContainerDeleteCer formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/CertificateStoreContainers/{id}" + localVarPath := apiBasePath + "/CertificateStoreContainers/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -231,9 +234,12 @@ func (a *CertificateStoreContainerApiService) CertificateStoreContainerGetAllCer localVarReturnValue []ModelsCertificateStoreContainerListResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/CertificateStoreContainers" + localVarPath := apiBasePath + "/CertificateStoreContainers" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} diff --git a/api/command/api_certificate_store_container_test.go b/api/command/api_certificate_store_container_test.go index 9343810..b0cc4a4 100644 --- a/api/command/api_certificate_store_container_test.go +++ b/api/command/api_certificate_store_container_test.go @@ -23,10 +23,13 @@ import ( "context" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "os" "testing" ) func Test_command_CertificateStoreContainerApiService(t *testing.T) { + cwd, _ := os.Getwd() + t.Logf("Working directory: %s", cwd) config := GetEnvConfiguration() configuration, configErr := NewConfiguration(config) @@ -36,9 +39,13 @@ func Test_command_CertificateStoreContainerApiService(t *testing.T) { t.Run("Test CertificateStoreContainerApiService CertificateStoreContainerDeleteCertificateStoreContainers", func(t *testing.T) { - var id int32 + var id interface{} - httpRes, err := apiClient.CertificateStoreContainerApi.CertificateStoreContainerDeleteCertificateStoreContainers(context.Background(), id).Execute() + id = os.Getenv("CertificateStoreContainerApi_CertificateStoreContainerDeleteCertificateStoreContainers_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("CertificateStoreContainerApi_CertificateStoreContainerDeleteCertificateStoreContainers_id: %v", id) + + httpRes, err := apiClient.CertificateStoreContainerApi.CertificateStoreContainerDeleteCertificateStoreContainers(context.Background(), id.(int32)).Execute() require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) diff --git a/api/command/api_certificate_store_test.go b/api/command/api_certificate_store_test.go index d038638..caece6d 100644 --- a/api/command/api_certificate_store_test.go +++ b/api/command/api_certificate_store_test.go @@ -23,10 +23,13 @@ import ( "context" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "os" "testing" ) func Test_command_CertificateStoreApiService(t *testing.T) { + cwd, _ := os.Getwd() + t.Logf("Working directory: %s", cwd) config := GetEnvConfiguration() configuration, configErr := NewConfiguration(config) @@ -74,9 +77,13 @@ func Test_command_CertificateStoreApiService(t *testing.T) { t.Run("Test CertificateStoreApiService CertificateStoreDeleteCertificateStore", func(t *testing.T) { - var id string + var id interface{} - httpRes, err := apiClient.CertificateStoreApi.CertificateStoreDeleteCertificateStore(context.Background(), id).Execute() + id = os.Getenv("CertificateStoreApi_CertificateStoreDeleteCertificateStore_id") + id, _ = convertParamInterface(id, "string") + t.Logf("CertificateStoreApi_CertificateStoreDeleteCertificateStore_id: %v", id) + + httpRes, err := apiClient.CertificateStoreApi.CertificateStoreDeleteCertificateStore(context.Background(), id.(string)).Execute() require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) @@ -94,9 +101,13 @@ func Test_command_CertificateStoreApiService(t *testing.T) { t.Run("Test CertificateStoreApiService CertificateStoreGetCertificateStoreInventory", func(t *testing.T) { - var id string + var id interface{} + + id = os.Getenv("CertificateStoreApi_CertificateStoreGetCertificateStoreInventory_id") + id, _ = convertParamInterface(id, "string") + t.Logf("CertificateStoreApi_CertificateStoreGetCertificateStoreInventory_id: %v", id) - resp, httpRes, err := apiClient.CertificateStoreApi.CertificateStoreGetCertificateStoreInventory(context.Background(), id).Execute() + resp, httpRes, err := apiClient.CertificateStoreApi.CertificateStoreGetCertificateStoreInventory(context.Background(), id.(string)).Execute() require.Nil(t, err) require.NotNil(t, resp) diff --git a/api/command/api_certificate_store_type.go b/api/command/api_certificate_store_type.go index 2e37de8..d86b12c 100644 --- a/api/command/api_certificate_store_type.go +++ b/api/command/api_certificate_store_type.go @@ -91,9 +91,12 @@ func (a *CertificateStoreTypeApiService) CertificateStoreTypeCreateCertificateSt localVarReturnValue *KeyfactorApiModelsCertificateStoresTypesCertificateStoreTypeResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/CertificateStoreTypes" + localVarPath := apiBasePath + "/CertificateStoreTypes" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -218,9 +221,12 @@ func (a *CertificateStoreTypeApiService) CertificateStoreTypeDeleteCertificateSt formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/CertificateStoreTypes/{id}" + localVarPath := apiBasePath + "/CertificateStoreTypes/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -336,9 +342,12 @@ func (a *CertificateStoreTypeApiService) CertificateStoreTypeDeleteCertificateSt formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/CertificateStoreTypes" + localVarPath := apiBasePath + "/CertificateStoreTypes" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -455,9 +464,12 @@ func (a *CertificateStoreTypeApiService) CertificateStoreTypeGetCertificateStore localVarReturnValue *KeyfactorApiModelsCertificateStoresTypesCertificateStoreTypeResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/CertificateStoreTypes/{id}" + localVarPath := apiBasePath + "/CertificateStoreTypes/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -579,9 +591,12 @@ func (a *CertificateStoreTypeApiService) CertificateStoreTypeGetCertificateStore localVarReturnValue []KeyfactorApiModelsCertificateStoresTypesCertificateStoreTypeResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/CertificateStoreTypes/Name/{name}" + localVarPath := apiBasePath + "/CertificateStoreTypes/Name/{name}" localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", url.PathEscape(parameterValueToString(r.name, "name")), -1) localVarHeaderParams := make(map[string]string) @@ -735,9 +750,12 @@ func (a *CertificateStoreTypeApiService) CertificateStoreTypeGetTypesExecute(r A localVarReturnValue []KeyfactorApiModelsCertificateStoresTypesCertificateStoreTypeResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/CertificateStoreTypes" + localVarPath := apiBasePath + "/CertificateStoreTypes" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -877,9 +895,12 @@ func (a *CertificateStoreTypeApiService) CertificateStoreTypeUpdateCertificateSt localVarReturnValue *KeyfactorApiModelsCertificateStoresTypesCertificateStoreTypeResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/CertificateStoreTypes" + localVarPath := apiBasePath + "/CertificateStoreTypes" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} diff --git a/api/command/api_certificate_store_type_test.go b/api/command/api_certificate_store_type_test.go index f19e39a..0fc4d9c 100644 --- a/api/command/api_certificate_store_type_test.go +++ b/api/command/api_certificate_store_type_test.go @@ -23,10 +23,13 @@ import ( "context" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "os" "testing" ) func Test_command_CertificateStoreTypeApiService(t *testing.T) { + cwd, _ := os.Getwd() + t.Logf("Working directory: %s", cwd) config := GetEnvConfiguration() configuration, configErr := NewConfiguration(config) @@ -46,9 +49,13 @@ func Test_command_CertificateStoreTypeApiService(t *testing.T) { t.Run("Test CertificateStoreTypeApiService CertificateStoreTypeDeleteCertificateStoreType", func(t *testing.T) { - var id int32 + var id interface{} - httpRes, err := apiClient.CertificateStoreTypeApi.CertificateStoreTypeDeleteCertificateStoreType(context.Background(), id).Execute() + id = os.Getenv("CertificateStoreTypeApi_CertificateStoreTypeDeleteCertificateStoreType_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("CertificateStoreTypeApi_CertificateStoreTypeDeleteCertificateStoreType_id: %v", id) + + httpRes, err := apiClient.CertificateStoreTypeApi.CertificateStoreTypeDeleteCertificateStoreType(context.Background(), id.(int32)).Execute() require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) @@ -66,9 +73,13 @@ func Test_command_CertificateStoreTypeApiService(t *testing.T) { t.Run("Test CertificateStoreTypeApiService CertificateStoreTypeGetCertificateStoreType0", func(t *testing.T) { - var id int32 + var id interface{} + + id = os.Getenv("CertificateStoreTypeApi_CertificateStoreTypeGetCertificateStoreType0_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("CertificateStoreTypeApi_CertificateStoreTypeGetCertificateStoreType0_id: %v", id) - resp, httpRes, err := apiClient.CertificateStoreTypeApi.CertificateStoreTypeGetCertificateStoreType0(context.Background(), id).Execute() + resp, httpRes, err := apiClient.CertificateStoreTypeApi.CertificateStoreTypeGetCertificateStoreType0(context.Background(), id.(int32)).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -78,9 +89,13 @@ func Test_command_CertificateStoreTypeApiService(t *testing.T) { t.Run("Test CertificateStoreTypeApiService CertificateStoreTypeGetCertificateStoreType1", func(t *testing.T) { - var name string + var name interface{} + + name = os.Getenv("CertificateStoreTypeApi_CertificateStoreTypeGetCertificateStoreType1_name") + name, _ = convertParamInterface(name, "string") + t.Logf("CertificateStoreTypeApi_CertificateStoreTypeGetCertificateStoreType1_name: %v", name) - resp, httpRes, err := apiClient.CertificateStoreTypeApi.CertificateStoreTypeGetCertificateStoreType1(context.Background(), name).Execute() + resp, httpRes, err := apiClient.CertificateStoreTypeApi.CertificateStoreTypeGetCertificateStoreType1(context.Background(), name.(string)).Execute() require.Nil(t, err) require.NotNil(t, resp) diff --git a/api/command/api_certificate_test.go b/api/command/api_certificate_test.go index 327f7ee..e072f6d 100644 --- a/api/command/api_certificate_test.go +++ b/api/command/api_certificate_test.go @@ -23,10 +23,13 @@ import ( "context" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "os" "testing" ) func Test_command_CertificateApiService(t *testing.T) { + cwd, _ := os.Getwd() + t.Logf("Working directory: %s", cwd) config := GetEnvConfiguration() configuration, configErr := NewConfiguration(config) @@ -46,9 +49,13 @@ func Test_command_CertificateApiService(t *testing.T) { t.Run("Test CertificateApiService CertificateCertificateHistory", func(t *testing.T) { - var id int32 + var id interface{} - resp, httpRes, err := apiClient.CertificateApi.CertificateCertificateHistory(context.Background(), id).Execute() + id = os.Getenv("CertificateApi_CertificateCertificateHistory_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("CertificateApi_CertificateCertificateHistory_id: %v", id) + + resp, httpRes, err := apiClient.CertificateApi.CertificateCertificateHistory(context.Background(), id.(int32)).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -77,9 +84,13 @@ func Test_command_CertificateApiService(t *testing.T) { t.Run("Test CertificateApiService CertificateDeleteCertificate", func(t *testing.T) { - var id int32 + var id interface{} + + id = os.Getenv("CertificateApi_CertificateDeleteCertificate_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("CertificateApi_CertificateDeleteCertificate_id: %v", id) - httpRes, err := apiClient.CertificateApi.CertificateDeleteCertificate(context.Background(), id).Execute() + httpRes, err := apiClient.CertificateApi.CertificateDeleteCertificate(context.Background(), id.(int32)).Execute() require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) @@ -106,9 +117,13 @@ func Test_command_CertificateApiService(t *testing.T) { t.Run("Test CertificateApiService CertificateDeletePrivateKeys1", func(t *testing.T) { - var id int32 + var id interface{} - httpRes, err := apiClient.CertificateApi.CertificateDeletePrivateKeys1(context.Background(), id).Execute() + id = os.Getenv("CertificateApi_CertificateDeletePrivateKeys1_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("CertificateApi_CertificateDeletePrivateKeys1_id: %v", id) + + httpRes, err := apiClient.CertificateApi.CertificateDeletePrivateKeys1(context.Background(), id.(int32)).Execute() require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) @@ -127,9 +142,13 @@ func Test_command_CertificateApiService(t *testing.T) { t.Run("Test CertificateApiService CertificateGetCertificate", func(t *testing.T) { - var id int32 + var id interface{} + + id = os.Getenv("CertificateApi_CertificateGetCertificate_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("CertificateApi_CertificateGetCertificate_id: %v", id) - resp, httpRes, err := apiClient.CertificateApi.CertificateGetCertificate(context.Background(), id).Execute() + resp, httpRes, err := apiClient.CertificateApi.CertificateGetCertificate(context.Background(), id.(int32)).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -139,9 +158,13 @@ func Test_command_CertificateApiService(t *testing.T) { t.Run("Test CertificateApiService CertificateGetCertificateLocations", func(t *testing.T) { - var id int32 + var id interface{} - resp, httpRes, err := apiClient.CertificateApi.CertificateGetCertificateLocations(context.Background(), id).Execute() + id = os.Getenv("CertificateApi_CertificateGetCertificateLocations_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("CertificateApi_CertificateGetCertificateLocations_id: %v", id) + + resp, httpRes, err := apiClient.CertificateApi.CertificateGetCertificateLocations(context.Background(), id.(int32)).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -151,9 +174,13 @@ func Test_command_CertificateApiService(t *testing.T) { t.Run("Test CertificateApiService CertificateGetCertificateSecurity", func(t *testing.T) { - var id int32 + var id interface{} + + id = os.Getenv("CertificateApi_CertificateGetCertificateSecurity_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("CertificateApi_CertificateGetCertificateSecurity_id: %v", id) - resp, httpRes, err := apiClient.CertificateApi.CertificateGetCertificateSecurity(context.Background(), id).Execute() + resp, httpRes, err := apiClient.CertificateApi.CertificateGetCertificateSecurity(context.Background(), id.(int32)).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -163,9 +190,13 @@ func Test_command_CertificateApiService(t *testing.T) { t.Run("Test CertificateApiService CertificateIdentityAudit", func(t *testing.T) { - var id int32 + var id interface{} - resp, httpRes, err := apiClient.CertificateApi.CertificateIdentityAudit(context.Background(), id).Execute() + id = os.Getenv("CertificateApi_CertificateIdentityAudit_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("CertificateApi_CertificateIdentityAudit_id: %v", id) + + resp, httpRes, err := apiClient.CertificateApi.CertificateIdentityAudit(context.Background(), id.(int32)).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -243,9 +274,13 @@ func Test_command_CertificateApiService(t *testing.T) { t.Run("Test CertificateApiService CertificateValidateCertificate", func(t *testing.T) { - var id int32 + var id interface{} + + id = os.Getenv("CertificateApi_CertificateValidateCertificate_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("CertificateApi_CertificateValidateCertificate_id: %v", id) - resp, httpRes, err := apiClient.CertificateApi.CertificateValidateCertificate(context.Background(), id).Execute() + resp, httpRes, err := apiClient.CertificateApi.CertificateValidateCertificate(context.Background(), id.(int32)).Execute() require.Nil(t, err) require.NotNil(t, resp) diff --git a/api/command/api_csr_generation.go b/api/command/api_csr_generation.go index 6f6bcf7..0cbbe26 100644 --- a/api/command/api_csr_generation.go +++ b/api/command/api_csr_generation.go @@ -84,9 +84,12 @@ func (a *CSRGenerationApiService) CSRGenerationDeleteCSRExecute(r ApiCSRGenerati formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/CSRGeneration/Pending/{id}" + localVarPath := apiBasePath + "/CSRGeneration/Pending/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -200,9 +203,12 @@ func (a *CSRGenerationApiService) CSRGenerationDeleteCSRsExecute(r ApiCSRGenerat formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/CSRGeneration/Pending" + localVarPath := apiBasePath + "/CSRGeneration/Pending" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -319,9 +325,12 @@ func (a *CSRGenerationApiService) CSRGenerationDownloadExecute(r ApiCSRGeneratio localVarReturnValue *ModelsCSRGenerationResponseModel ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/CSRGeneration/Pending/{id}" + localVarPath := apiBasePath + "/CSRGeneration/Pending/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -475,9 +484,12 @@ func (a *CSRGenerationApiService) CSRGenerationGetPendingCSRsExecute(r ApiCSRGen localVarReturnValue []ModelsPendingCSRResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/CSRGeneration/Pending" + localVarPath := apiBasePath + "/CSRGeneration/Pending" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -617,9 +629,12 @@ func (a *CSRGenerationApiService) CSRGenerationPostGenerateExecute(r ApiCSRGener localVarReturnValue *ModelsCSRContents ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/CSRGeneration/Generate" + localVarPath := apiBasePath + "/CSRGeneration/Generate" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} diff --git a/api/command/api_csr_generation_test.go b/api/command/api_csr_generation_test.go index d25377d..2c30af6 100644 --- a/api/command/api_csr_generation_test.go +++ b/api/command/api_csr_generation_test.go @@ -23,10 +23,13 @@ import ( "context" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "os" "testing" ) func Test_command_CSRGenerationApiService(t *testing.T) { + cwd, _ := os.Getwd() + t.Logf("Working directory: %s", cwd) config := GetEnvConfiguration() configuration, configErr := NewConfiguration(config) @@ -36,9 +39,13 @@ func Test_command_CSRGenerationApiService(t *testing.T) { t.Run("Test CSRGenerationApiService CSRGenerationDeleteCSR", func(t *testing.T) { - var id int32 + var id interface{} - httpRes, err := apiClient.CSRGenerationApi.CSRGenerationDeleteCSR(context.Background(), id).Execute() + id = os.Getenv("CSRGenerationApi_CSRGenerationDeleteCSR_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("CSRGenerationApi_CSRGenerationDeleteCSR_id: %v", id) + + httpRes, err := apiClient.CSRGenerationApi.CSRGenerationDeleteCSR(context.Background(), id.(int32)).Execute() require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) @@ -56,9 +63,13 @@ func Test_command_CSRGenerationApiService(t *testing.T) { t.Run("Test CSRGenerationApiService CSRGenerationDownload", func(t *testing.T) { - var id int32 + var id interface{} + + id = os.Getenv("CSRGenerationApi_CSRGenerationDownload_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("CSRGenerationApi_CSRGenerationDownload_id: %v", id) - resp, httpRes, err := apiClient.CSRGenerationApi.CSRGenerationDownload(context.Background(), id).Execute() + resp, httpRes, err := apiClient.CSRGenerationApi.CSRGenerationDownload(context.Background(), id.(int32)).Execute() require.Nil(t, err) require.NotNil(t, resp) diff --git a/api/command/api_custom_job_type.go b/api/command/api_custom_job_type.go index 12f49c8..9b991f6 100644 --- a/api/command/api_custom_job_type.go +++ b/api/command/api_custom_job_type.go @@ -91,9 +91,12 @@ func (a *CustomJobTypeApiService) CustomJobTypeCreateJobTypeExecute(r ApiCustomJ localVarReturnValue *KeyfactorApiModelsOrchestratorJobsJobTypeResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/JobTypes/Custom" + localVarPath := apiBasePath + "/JobTypes/Custom" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -216,9 +219,12 @@ func (a *CustomJobTypeApiService) CustomJobTypeDeleteJobTypeExecute(r ApiCustomJ formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/JobTypes/Custom/{id}" + localVarPath := apiBasePath + "/JobTypes/Custom/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -331,9 +337,12 @@ func (a *CustomJobTypeApiService) CustomJobTypeGetJobTypeByIdExecute(r ApiCustom localVarReturnValue *KeyfactorApiModelsOrchestratorJobsJobTypeResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/JobTypes/Custom/{id}" + localVarPath := apiBasePath + "/JobTypes/Custom/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -487,9 +496,12 @@ func (a *CustomJobTypeApiService) CustomJobTypeGetJobTypesExecute(r ApiCustomJob localVarReturnValue []KeyfactorApiModelsOrchestratorJobsJobTypeResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/JobTypes/Custom" + localVarPath := apiBasePath + "/JobTypes/Custom" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -629,9 +641,12 @@ func (a *CustomJobTypeApiService) CustomJobTypeUpdateJobTypeExecute(r ApiCustomJ localVarReturnValue *KeyfactorApiModelsOrchestratorJobsJobTypeResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/JobTypes/Custom" + localVarPath := apiBasePath + "/JobTypes/Custom" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} diff --git a/api/command/api_custom_job_type_test.go b/api/command/api_custom_job_type_test.go index 792d85a..2d748cf 100644 --- a/api/command/api_custom_job_type_test.go +++ b/api/command/api_custom_job_type_test.go @@ -23,10 +23,13 @@ import ( "context" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "os" "testing" ) func Test_command_CustomJobTypeApiService(t *testing.T) { + cwd, _ := os.Getwd() + t.Logf("Working directory: %s", cwd) config := GetEnvConfiguration() configuration, configErr := NewConfiguration(config) @@ -46,9 +49,13 @@ func Test_command_CustomJobTypeApiService(t *testing.T) { t.Run("Test CustomJobTypeApiService CustomJobTypeDeleteJobType", func(t *testing.T) { - var id string + var id interface{} - httpRes, err := apiClient.CustomJobTypeApi.CustomJobTypeDeleteJobType(context.Background(), id).Execute() + id = os.Getenv("CustomJobTypeApi_CustomJobTypeDeleteJobType_id") + id, _ = convertParamInterface(id, "string") + t.Logf("CustomJobTypeApi_CustomJobTypeDeleteJobType_id: %v", id) + + httpRes, err := apiClient.CustomJobTypeApi.CustomJobTypeDeleteJobType(context.Background(), id.(string)).Execute() require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) @@ -57,9 +64,13 @@ func Test_command_CustomJobTypeApiService(t *testing.T) { t.Run("Test CustomJobTypeApiService CustomJobTypeGetJobTypeById", func(t *testing.T) { - var id string + var id interface{} + + id = os.Getenv("CustomJobTypeApi_CustomJobTypeGetJobTypeById_id") + id, _ = convertParamInterface(id, "string") + t.Logf("CustomJobTypeApi_CustomJobTypeGetJobTypeById_id: %v", id) - resp, httpRes, err := apiClient.CustomJobTypeApi.CustomJobTypeGetJobTypeById(context.Background(), id).Execute() + resp, httpRes, err := apiClient.CustomJobTypeApi.CustomJobTypeGetJobTypeById(context.Background(), id.(string)).Execute() require.Nil(t, err) require.NotNil(t, resp) diff --git a/api/command/api_denied_alert.go b/api/command/api_denied_alert.go index ee18832..08c91fa 100644 --- a/api/command/api_denied_alert.go +++ b/api/command/api_denied_alert.go @@ -91,9 +91,12 @@ func (a *DeniedAlertApiService) DeniedAlertAddDeniedAlertExecute(r ApiDeniedAler localVarReturnValue *KeyfactorApiModelsAlertsDeniedDeniedAlertDefinitionResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Alerts/Denied" + localVarPath := apiBasePath + "/Alerts/Denied" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -216,9 +219,12 @@ func (a *DeniedAlertApiService) DeniedAlertDeleteDeniedAlertExecute(r ApiDeniedA formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Alerts/Denied/{id}" + localVarPath := apiBasePath + "/Alerts/Denied/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -335,9 +341,12 @@ func (a *DeniedAlertApiService) DeniedAlertEditDeniedAlertExecute(r ApiDeniedAle localVarReturnValue *KeyfactorApiModelsAlertsDeniedDeniedAlertDefinitionResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Alerts/Denied" + localVarPath := apiBasePath + "/Alerts/Denied" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -463,9 +472,12 @@ func (a *DeniedAlertApiService) DeniedAlertGetDeniedAlertExecute(r ApiDeniedAler localVarReturnValue *KeyfactorApiModelsAlertsDeniedDeniedAlertDefinitionResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Alerts/Denied/{id}" + localVarPath := apiBasePath + "/Alerts/Denied/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -619,9 +631,12 @@ func (a *DeniedAlertApiService) DeniedAlertGetDeniedAlertsExecute(r ApiDeniedAle localVarReturnValue []KeyfactorApiModelsAlertsDeniedDeniedAlertDefinitionResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Alerts/Denied" + localVarPath := apiBasePath + "/Alerts/Denied" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} diff --git a/api/command/api_denied_alert_test.go b/api/command/api_denied_alert_test.go index f09da8f..11bd141 100644 --- a/api/command/api_denied_alert_test.go +++ b/api/command/api_denied_alert_test.go @@ -23,10 +23,13 @@ import ( "context" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "os" "testing" ) func Test_command_DeniedAlertApiService(t *testing.T) { + cwd, _ := os.Getwd() + t.Logf("Working directory: %s", cwd) config := GetEnvConfiguration() configuration, configErr := NewConfiguration(config) @@ -46,9 +49,13 @@ func Test_command_DeniedAlertApiService(t *testing.T) { t.Run("Test DeniedAlertApiService DeniedAlertDeleteDeniedAlert", func(t *testing.T) { - var id int32 + var id interface{} - httpRes, err := apiClient.DeniedAlertApi.DeniedAlertDeleteDeniedAlert(context.Background(), id).Execute() + id = os.Getenv("DeniedAlertApi_DeniedAlertDeleteDeniedAlert_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("DeniedAlertApi_DeniedAlertDeleteDeniedAlert_id: %v", id) + + httpRes, err := apiClient.DeniedAlertApi.DeniedAlertDeleteDeniedAlert(context.Background(), id.(int32)).Execute() require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) @@ -67,9 +74,13 @@ func Test_command_DeniedAlertApiService(t *testing.T) { t.Run("Test DeniedAlertApiService DeniedAlertGetDeniedAlert", func(t *testing.T) { - var id int32 + var id interface{} + + id = os.Getenv("DeniedAlertApi_DeniedAlertGetDeniedAlert_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("DeniedAlertApi_DeniedAlertGetDeniedAlert_id: %v", id) - resp, httpRes, err := apiClient.DeniedAlertApi.DeniedAlertGetDeniedAlert(context.Background(), id).Execute() + resp, httpRes, err := apiClient.DeniedAlertApi.DeniedAlertGetDeniedAlert(context.Background(), id.(int32)).Execute() require.Nil(t, err) require.NotNil(t, resp) diff --git a/api/command/api_enrollment.go b/api/command/api_enrollment.go index 7d3cd7d..0b61bc0 100644 --- a/api/command/api_enrollment.go +++ b/api/command/api_enrollment.go @@ -91,9 +91,12 @@ func (a *EnrollmentApiService) EnrollmentAddToExistingCertStoresExecute(r ApiEnr localVarReturnValue *KeyfactorAPIModelsEnrollmentEnrollmentManagementResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Enrollment/PFX/Replace" + localVarPath := apiBasePath + "/Enrollment/PFX/Replace" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -233,9 +236,12 @@ func (a *EnrollmentApiService) EnrollmentAvailableRenewalIdExecute(r ApiEnrollme localVarReturnValue *ModelsEnrollmentAvailableRenewal ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Enrollment/AvailableRenewal/Id/{id}" + localVarPath := apiBasePath + "/Enrollment/AvailableRenewal/Id/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -367,9 +373,12 @@ func (a *EnrollmentApiService) EnrollmentAvailableRenewalThumbprintExecute(r Api localVarReturnValue *ModelsEnrollmentAvailableRenewal ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Enrollment/AvailableRenewal/Thumbprint/{thumbprint}" + localVarPath := apiBasePath + "/Enrollment/AvailableRenewal/Thumbprint/{thumbprint}" localVarPath = strings.Replace(localVarPath, "{"+"thumbprint"+"}", url.PathEscape(parameterValueToString(r.thumbprint, "thumbprint")), -1) localVarHeaderParams := make(map[string]string) @@ -491,9 +500,12 @@ func (a *EnrollmentApiService) EnrollmentGetMyCSRContextExecute(r ApiEnrollmentG localVarReturnValue *CoreModelsEnrollmentEnrollmentTemplateCAResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Enrollment/CSR/Context/My" + localVarPath := apiBasePath + "/Enrollment/CSR/Context/My" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -611,9 +623,12 @@ func (a *EnrollmentApiService) EnrollmentGetMyPFXContextExecute(r ApiEnrollmentG localVarReturnValue *CoreModelsEnrollmentEnrollmentTemplateCAResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Enrollment/PFX/Context/My" + localVarPath := apiBasePath + "/Enrollment/PFX/Context/My" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -734,9 +749,12 @@ func (a *EnrollmentApiService) EnrollmentGetTemplateEnrollmentSettingsExecute(r localVarReturnValue *KeyfactorApiModelsTemplatesTemplateEnrollmentSettingsResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Enrollment/Settings/{id}" + localVarPath := apiBasePath + "/Enrollment/Settings/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -862,9 +880,12 @@ func (a *EnrollmentApiService) EnrollmentInstallPFXToCertStoreExecute(r ApiEnrol localVarReturnValue *KeyfactorAPIModelsEnrollmentEnrollmentManagementResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Enrollment/PFX/Deploy" + localVarPath := apiBasePath + "/Enrollment/PFX/Deploy" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1018,9 +1039,12 @@ func (a *EnrollmentApiService) EnrollmentPostCSREnrollExecute(r ApiEnrollmentPos localVarReturnValue *ModelsEnrollmentCSREnrollmentResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Enrollment/CSR" + localVarPath := apiBasePath + "/Enrollment/CSR" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1181,9 +1205,12 @@ func (a *EnrollmentApiService) EnrollmentPostPFXEnrollExecute(r ApiEnrollmentPos localVarReturnValue *ModelsEnrollmentPFXEnrollmentResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Enrollment/PFX" + localVarPath := apiBasePath + "/Enrollment/PFX" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1319,9 +1346,12 @@ func (a *EnrollmentApiService) EnrollmentPostParsedCSRExecute(r ApiEnrollmentPos localVarReturnValue []string ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Enrollment/CSR/Parse" + localVarPath := apiBasePath + "/Enrollment/CSR/Parse" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1458,9 +1488,12 @@ func (a *EnrollmentApiService) EnrollmentRenewExecute(r ApiEnrollmentRenewReques localVarReturnValue *ModelsEnrollmentRenewalResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Enrollment/Renew" + localVarPath := apiBasePath + "/Enrollment/Renew" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} diff --git a/api/command/api_enrollment_test.go b/api/command/api_enrollment_test.go index fba49e3..9b9a43f 100644 --- a/api/command/api_enrollment_test.go +++ b/api/command/api_enrollment_test.go @@ -23,10 +23,13 @@ import ( "context" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "os" "testing" ) func Test_command_EnrollmentApiService(t *testing.T) { + cwd, _ := os.Getwd() + t.Logf("Working directory: %s", cwd) config := GetEnvConfiguration() configuration, configErr := NewConfiguration(config) @@ -46,9 +49,13 @@ func Test_command_EnrollmentApiService(t *testing.T) { t.Run("Test EnrollmentApiService EnrollmentAvailableRenewalId", func(t *testing.T) { - var id int32 + var id interface{} - resp, httpRes, err := apiClient.EnrollmentApi.EnrollmentAvailableRenewalId(context.Background(), id).Execute() + id = os.Getenv("EnrollmentApi_EnrollmentAvailableRenewalId_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("EnrollmentApi_EnrollmentAvailableRenewalId_id: %v", id) + + resp, httpRes, err := apiClient.EnrollmentApi.EnrollmentAvailableRenewalId(context.Background(), id.(int32)).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -58,9 +65,13 @@ func Test_command_EnrollmentApiService(t *testing.T) { t.Run("Test EnrollmentApiService EnrollmentAvailableRenewalThumbprint", func(t *testing.T) { - var thumbprint string + var thumbprint interface{} + + thumbprint = os.Getenv("EnrollmentApi_EnrollmentAvailableRenewalThumbprint_thumbprint") + thumbprint, _ = convertParamInterface(thumbprint, "string") + t.Logf("EnrollmentApi_EnrollmentAvailableRenewalThumbprint_thumbprint: %v", thumbprint) - resp, httpRes, err := apiClient.EnrollmentApi.EnrollmentAvailableRenewalThumbprint(context.Background(), thumbprint).Execute() + resp, httpRes, err := apiClient.EnrollmentApi.EnrollmentAvailableRenewalThumbprint(context.Background(), thumbprint.(string)).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -90,9 +101,13 @@ func Test_command_EnrollmentApiService(t *testing.T) { t.Run("Test EnrollmentApiService EnrollmentGetTemplateEnrollmentSettings", func(t *testing.T) { - var id int32 + var id interface{} + + id = os.Getenv("EnrollmentApi_EnrollmentGetTemplateEnrollmentSettings_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("EnrollmentApi_EnrollmentGetTemplateEnrollmentSettings_id: %v", id) - resp, httpRes, err := apiClient.EnrollmentApi.EnrollmentGetTemplateEnrollmentSettings(context.Background(), id).Execute() + resp, httpRes, err := apiClient.EnrollmentApi.EnrollmentGetTemplateEnrollmentSettings(context.Background(), id.(int32)).Execute() require.Nil(t, err) require.NotNil(t, resp) diff --git a/api/command/api_expiration_alert.go b/api/command/api_expiration_alert.go index 21e500d..18ac6ea 100644 --- a/api/command/api_expiration_alert.go +++ b/api/command/api_expiration_alert.go @@ -91,9 +91,12 @@ func (a *ExpirationAlertApiService) ExpirationAlertAddExpirationAlertExecute(r A localVarReturnValue *KeyfactorApiModelsAlertsExpirationExpirationAlertDefinitionResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Alerts/Expiration" + localVarPath := apiBasePath + "/Alerts/Expiration" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -216,9 +219,12 @@ func (a *ExpirationAlertApiService) ExpirationAlertDeleteExpirationAlertExecute( formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Alerts/Expiration/{id}" + localVarPath := apiBasePath + "/Alerts/Expiration/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -335,9 +341,12 @@ func (a *ExpirationAlertApiService) ExpirationAlertEditExpirationAlertExecute(r localVarReturnValue *KeyfactorApiModelsAlertsExpirationExpirationAlertDefinitionResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Alerts/Expiration" + localVarPath := apiBasePath + "/Alerts/Expiration" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -466,9 +475,12 @@ func (a *ExpirationAlertApiService) ExpirationAlertEditScheduleExecute(r ApiExpi localVarReturnValue *KeyfactorApiModelsAlertsAlertScheduleAlertScheduleResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Alerts/Expiration/Schedule" + localVarPath := apiBasePath + "/Alerts/Expiration/Schedule" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -594,9 +606,12 @@ func (a *ExpirationAlertApiService) ExpirationAlertGetExpirationAlertExecute(r A localVarReturnValue *KeyfactorApiModelsAlertsExpirationExpirationAlertDefinitionResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Alerts/Expiration/{id}" + localVarPath := apiBasePath + "/Alerts/Expiration/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -750,9 +765,12 @@ func (a *ExpirationAlertApiService) ExpirationAlertGetExpirationAlertsExecute(r localVarReturnValue []KeyfactorApiModelsAlertsExpirationExpirationAlertDefinitionResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Alerts/Expiration" + localVarPath := apiBasePath + "/Alerts/Expiration" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -885,9 +903,12 @@ func (a *ExpirationAlertApiService) ExpirationAlertGetScheduleExecute(r ApiExpir localVarReturnValue *KeyfactorApiModelsAlertsAlertScheduleAlertScheduleResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Alerts/Expiration/Schedule" + localVarPath := apiBasePath + "/Alerts/Expiration/Schedule" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1012,9 +1033,12 @@ func (a *ExpirationAlertApiService) ExpirationAlertTestAllExpirationAlertExecute localVarReturnValue *KeyfactorApiModelsAlertsExpirationExpirationAlertTestResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Alerts/Expiration/TestAll" + localVarPath := apiBasePath + "/Alerts/Expiration/TestAll" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1144,9 +1168,12 @@ func (a *ExpirationAlertApiService) ExpirationAlertTestExpirationAlertExecute(r localVarReturnValue *KeyfactorApiModelsAlertsExpirationExpirationAlertTestResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Alerts/Expiration/Test" + localVarPath := apiBasePath + "/Alerts/Expiration/Test" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} diff --git a/api/command/api_expiration_alert_test.go b/api/command/api_expiration_alert_test.go index 2b4b5aa..0e68aaa 100644 --- a/api/command/api_expiration_alert_test.go +++ b/api/command/api_expiration_alert_test.go @@ -23,10 +23,13 @@ import ( "context" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "os" "testing" ) func Test_command_ExpirationAlertApiService(t *testing.T) { + cwd, _ := os.Getwd() + t.Logf("Working directory: %s", cwd) config := GetEnvConfiguration() configuration, configErr := NewConfiguration(config) @@ -46,9 +49,13 @@ func Test_command_ExpirationAlertApiService(t *testing.T) { t.Run("Test ExpirationAlertApiService ExpirationAlertDeleteExpirationAlert", func(t *testing.T) { - var id int32 + var id interface{} - httpRes, err := apiClient.ExpirationAlertApi.ExpirationAlertDeleteExpirationAlert(context.Background(), id).Execute() + id = os.Getenv("ExpirationAlertApi_ExpirationAlertDeleteExpirationAlert_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("ExpirationAlertApi_ExpirationAlertDeleteExpirationAlert_id: %v", id) + + httpRes, err := apiClient.ExpirationAlertApi.ExpirationAlertDeleteExpirationAlert(context.Background(), id.(int32)).Execute() require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) @@ -77,9 +84,13 @@ func Test_command_ExpirationAlertApiService(t *testing.T) { t.Run("Test ExpirationAlertApiService ExpirationAlertGetExpirationAlert", func(t *testing.T) { - var id int32 + var id interface{} + + id = os.Getenv("ExpirationAlertApi_ExpirationAlertGetExpirationAlert_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("ExpirationAlertApi_ExpirationAlertGetExpirationAlert_id: %v", id) - resp, httpRes, err := apiClient.ExpirationAlertApi.ExpirationAlertGetExpirationAlert(context.Background(), id).Execute() + resp, httpRes, err := apiClient.ExpirationAlertApi.ExpirationAlertGetExpirationAlert(context.Background(), id.(int32)).Execute() require.Nil(t, err) require.NotNil(t, resp) diff --git a/api/command/api_issued_alert.go b/api/command/api_issued_alert.go index 66ab1b9..eaf91ab 100644 --- a/api/command/api_issued_alert.go +++ b/api/command/api_issued_alert.go @@ -91,9 +91,12 @@ func (a *IssuedAlertApiService) IssuedAlertAddIssuedAlertExecute(r ApiIssuedAler localVarReturnValue *KeyfactorApiModelsAlertsIssuedIssuedAlertDefinitionResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Alerts/Issued" + localVarPath := apiBasePath + "/Alerts/Issued" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -216,9 +219,12 @@ func (a *IssuedAlertApiService) IssuedAlertDeleteIssuedAlertExecute(r ApiIssuedA formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Alerts/Issued/{id}" + localVarPath := apiBasePath + "/Alerts/Issued/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -335,9 +341,12 @@ func (a *IssuedAlertApiService) IssuedAlertEditIssuedAlertExecute(r ApiIssuedAle localVarReturnValue *KeyfactorApiModelsAlertsIssuedIssuedAlertDefinitionResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Alerts/Issued" + localVarPath := apiBasePath + "/Alerts/Issued" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -466,9 +475,12 @@ func (a *IssuedAlertApiService) IssuedAlertEditScheduleExecute(r ApiIssuedAlertE localVarReturnValue *KeyfactorApiModelsAlertsAlertScheduleAlertScheduleResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Alerts/Issued/Schedule" + localVarPath := apiBasePath + "/Alerts/Issued/Schedule" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -594,9 +606,12 @@ func (a *IssuedAlertApiService) IssuedAlertGetIssuedAlertExecute(r ApiIssuedAler localVarReturnValue *KeyfactorApiModelsAlertsIssuedIssuedAlertDefinitionResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Alerts/Issued/{id}" + localVarPath := apiBasePath + "/Alerts/Issued/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -750,9 +765,12 @@ func (a *IssuedAlertApiService) IssuedAlertGetIssuedAlertsExecute(r ApiIssuedAle localVarReturnValue []KeyfactorApiModelsAlertsIssuedIssuedAlertDefinitionResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Alerts/Issued" + localVarPath := apiBasePath + "/Alerts/Issued" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -885,9 +903,12 @@ func (a *IssuedAlertApiService) IssuedAlertGetScheduleExecute(r ApiIssuedAlertGe localVarReturnValue *KeyfactorApiModelsAlertsAlertScheduleAlertScheduleResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Alerts/Issued/Schedule" + localVarPath := apiBasePath + "/Alerts/Issued/Schedule" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} diff --git a/api/command/api_issued_alert_test.go b/api/command/api_issued_alert_test.go index 5080ce7..0d4315c 100644 --- a/api/command/api_issued_alert_test.go +++ b/api/command/api_issued_alert_test.go @@ -23,10 +23,13 @@ import ( "context" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "os" "testing" ) func Test_command_IssuedAlertApiService(t *testing.T) { + cwd, _ := os.Getwd() + t.Logf("Working directory: %s", cwd) config := GetEnvConfiguration() configuration, configErr := NewConfiguration(config) @@ -46,9 +49,13 @@ func Test_command_IssuedAlertApiService(t *testing.T) { t.Run("Test IssuedAlertApiService IssuedAlertDeleteIssuedAlert", func(t *testing.T) { - var id int32 + var id interface{} - httpRes, err := apiClient.IssuedAlertApi.IssuedAlertDeleteIssuedAlert(context.Background(), id).Execute() + id = os.Getenv("IssuedAlertApi_IssuedAlertDeleteIssuedAlert_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("IssuedAlertApi_IssuedAlertDeleteIssuedAlert_id: %v", id) + + httpRes, err := apiClient.IssuedAlertApi.IssuedAlertDeleteIssuedAlert(context.Background(), id.(int32)).Execute() require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) @@ -77,9 +84,13 @@ func Test_command_IssuedAlertApiService(t *testing.T) { t.Run("Test IssuedAlertApiService IssuedAlertGetIssuedAlert", func(t *testing.T) { - var id int32 + var id interface{} + + id = os.Getenv("IssuedAlertApi_IssuedAlertGetIssuedAlert_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("IssuedAlertApi_IssuedAlertGetIssuedAlert_id: %v", id) - resp, httpRes, err := apiClient.IssuedAlertApi.IssuedAlertGetIssuedAlert(context.Background(), id).Execute() + resp, httpRes, err := apiClient.IssuedAlertApi.IssuedAlertGetIssuedAlert(context.Background(), id.(int32)).Execute() require.Nil(t, err) require.NotNil(t, resp) diff --git a/api/command/api_key.go b/api/command/api_key.go index 5548443..3dcab06 100644 --- a/api/command/api_key.go +++ b/api/command/api_key.go @@ -84,9 +84,12 @@ func (a *KeyApiService) KeyDeleteUnmanagedKeyExecute(r ApiKeyDeleteUnmanagedKeyR formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSH/Keys/Unmanaged/{id}" + localVarPath := apiBasePath + "/SSH/Keys/Unmanaged/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -200,9 +203,12 @@ func (a *KeyApiService) KeyDeleteUnmanagedKeysExecute(r ApiKeyDeleteUnmanagedKey formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSH/Keys/Unmanaged" + localVarPath := apiBasePath + "/SSH/Keys/Unmanaged" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -338,9 +344,12 @@ func (a *KeyApiService) KeyGenerateKeyExecute(r ApiKeyGenerateKeyRequest) (*Mode localVarReturnValue *ModelsSSHKeysKeyResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSH/Keys/MyKey" + localVarPath := apiBasePath + "/SSH/Keys/MyKey" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -477,9 +486,12 @@ func (a *KeyApiService) KeyGetMyKeyExecute(r ApiKeyGetMyKeyRequest) (*ModelsSSHK localVarReturnValue *ModelsSSHKeysKeyResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSH/Keys/MyKey" + localVarPath := apiBasePath + "/SSH/Keys/MyKey" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -607,9 +619,12 @@ func (a *KeyApiService) KeyGetUnmanagedKeyExecute(r ApiKeyGetUnmanagedKeyRequest localVarReturnValue *ModelsSSHKeysUnmanagedKeyResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSH/Keys/Unmanaged/{id}" + localVarPath := apiBasePath + "/SSH/Keys/Unmanaged/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -763,9 +778,12 @@ func (a *KeyApiService) KeyGetUnmanagedKeysExecute(r ApiKeyGetUnmanagedKeysReque localVarReturnValue []ModelsSSHKeysUnmanagedKeyResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSH/Keys/Unmanaged" + localVarPath := apiBasePath + "/SSH/Keys/Unmanaged" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -905,9 +923,12 @@ func (a *KeyApiService) KeyUpdateExecute(r ApiKeyUpdateRequest) (*ModelsSSHKeysK localVarReturnValue *ModelsSSHKeysKeyResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSH/Keys/MyKey" + localVarPath := apiBasePath + "/SSH/Keys/MyKey" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} diff --git a/api/command/api_key_rotation_alert.go b/api/command/api_key_rotation_alert.go index e0a53ce..e804449 100644 --- a/api/command/api_key_rotation_alert.go +++ b/api/command/api_key_rotation_alert.go @@ -91,9 +91,12 @@ func (a *KeyRotationAlertApiService) KeyRotationAlertAddKeyRotationAlertExecute( localVarReturnValue *KeyfactorApiModelsAlertsKeyRotationKeyRotationAlertDefinitionResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Alerts/KeyRotation" + localVarPath := apiBasePath + "/Alerts/KeyRotation" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -216,9 +219,12 @@ func (a *KeyRotationAlertApiService) KeyRotationAlertDeleteKeyRotationAlertExecu formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Alerts/KeyRotation/{id}" + localVarPath := apiBasePath + "/Alerts/KeyRotation/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -335,9 +341,12 @@ func (a *KeyRotationAlertApiService) KeyRotationAlertEditKeyRotationAlertExecute localVarReturnValue *KeyfactorApiModelsAlertsKeyRotationKeyRotationAlertDefinitionResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Alerts/KeyRotation" + localVarPath := apiBasePath + "/Alerts/KeyRotation" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -466,9 +475,12 @@ func (a *KeyRotationAlertApiService) KeyRotationAlertEditScheduleExecute(r ApiKe localVarReturnValue *KeyfactorApiModelsAlertsAlertScheduleAlertScheduleResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Alerts/KeyRotation/Schedule" + localVarPath := apiBasePath + "/Alerts/KeyRotation/Schedule" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -594,9 +606,12 @@ func (a *KeyRotationAlertApiService) KeyRotationAlertGetKeyRotationAlertExecute( localVarReturnValue *KeyfactorApiModelsAlertsKeyRotationKeyRotationAlertDefinitionResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Alerts/KeyRotation/{id}" + localVarPath := apiBasePath + "/Alerts/KeyRotation/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -750,9 +765,12 @@ func (a *KeyRotationAlertApiService) KeyRotationAlertGetKeyRotationAlertsExecute localVarReturnValue []KeyfactorApiModelsAlertsKeyRotationKeyRotationAlertDefinitionResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Alerts/KeyRotation" + localVarPath := apiBasePath + "/Alerts/KeyRotation" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -885,9 +903,12 @@ func (a *KeyRotationAlertApiService) KeyRotationAlertGetScheduleExecute(r ApiKey localVarReturnValue *KeyfactorApiModelsAlertsAlertScheduleAlertScheduleResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Alerts/KeyRotation/Schedule" + localVarPath := apiBasePath + "/Alerts/KeyRotation/Schedule" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1012,9 +1033,12 @@ func (a *KeyRotationAlertApiService) KeyRotationAlertTestAllKeyRotationAlertExec localVarReturnValue *KeyfactorApiModelsAlertsKeyRotationKeyRotationAlertTestResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Alerts/KeyRotation/TestAll" + localVarPath := apiBasePath + "/Alerts/KeyRotation/TestAll" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1144,9 +1168,12 @@ func (a *KeyRotationAlertApiService) KeyRotationAlertTestKeyRotationAlertExecute localVarReturnValue *KeyfactorApiModelsAlertsKeyRotationKeyRotationAlertTestResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Alerts/KeyRotation/Test" + localVarPath := apiBasePath + "/Alerts/KeyRotation/Test" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} diff --git a/api/command/api_key_rotation_alert_test.go b/api/command/api_key_rotation_alert_test.go index de598c6..924ce28 100644 --- a/api/command/api_key_rotation_alert_test.go +++ b/api/command/api_key_rotation_alert_test.go @@ -23,10 +23,13 @@ import ( "context" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "os" "testing" ) func Test_command_KeyRotationAlertApiService(t *testing.T) { + cwd, _ := os.Getwd() + t.Logf("Working directory: %s", cwd) config := GetEnvConfiguration() configuration, configErr := NewConfiguration(config) @@ -46,9 +49,13 @@ func Test_command_KeyRotationAlertApiService(t *testing.T) { t.Run("Test KeyRotationAlertApiService KeyRotationAlertDeleteKeyRotationAlert", func(t *testing.T) { - var id int32 + var id interface{} - httpRes, err := apiClient.KeyRotationAlertApi.KeyRotationAlertDeleteKeyRotationAlert(context.Background(), id).Execute() + id = os.Getenv("KeyRotationAlertApi_KeyRotationAlertDeleteKeyRotationAlert_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("KeyRotationAlertApi_KeyRotationAlertDeleteKeyRotationAlert_id: %v", id) + + httpRes, err := apiClient.KeyRotationAlertApi.KeyRotationAlertDeleteKeyRotationAlert(context.Background(), id.(int32)).Execute() require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) @@ -77,9 +84,13 @@ func Test_command_KeyRotationAlertApiService(t *testing.T) { t.Run("Test KeyRotationAlertApiService KeyRotationAlertGetKeyRotationAlert", func(t *testing.T) { - var id int32 + var id interface{} + + id = os.Getenv("KeyRotationAlertApi_KeyRotationAlertGetKeyRotationAlert_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("KeyRotationAlertApi_KeyRotationAlertGetKeyRotationAlert_id: %v", id) - resp, httpRes, err := apiClient.KeyRotationAlertApi.KeyRotationAlertGetKeyRotationAlert(context.Background(), id).Execute() + resp, httpRes, err := apiClient.KeyRotationAlertApi.KeyRotationAlertGetKeyRotationAlert(context.Background(), id.(int32)).Execute() require.Nil(t, err) require.NotNil(t, resp) diff --git a/api/command/api_key_test.go b/api/command/api_key_test.go index 88dbc31..6218e01 100644 --- a/api/command/api_key_test.go +++ b/api/command/api_key_test.go @@ -23,10 +23,13 @@ import ( "context" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "os" "testing" ) func Test_command_KeyApiService(t *testing.T) { + cwd, _ := os.Getwd() + t.Logf("Working directory: %s", cwd) config := GetEnvConfiguration() configuration, configErr := NewConfiguration(config) @@ -36,9 +39,13 @@ func Test_command_KeyApiService(t *testing.T) { t.Run("Test KeyApiService KeyDeleteUnmanagedKey", func(t *testing.T) { - var id int32 + var id interface{} - httpRes, err := apiClient.KeyApi.KeyDeleteUnmanagedKey(context.Background(), id).Execute() + id = os.Getenv("KeyApi_KeyDeleteUnmanagedKey_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("KeyApi_KeyDeleteUnmanagedKey_id: %v", id) + + httpRes, err := apiClient.KeyApi.KeyDeleteUnmanagedKey(context.Background(), id.(int32)).Execute() require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) @@ -76,9 +83,13 @@ func Test_command_KeyApiService(t *testing.T) { t.Run("Test KeyApiService KeyGetUnmanagedKey", func(t *testing.T) { - var id int32 + var id interface{} + + id = os.Getenv("KeyApi_KeyGetUnmanagedKey_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("KeyApi_KeyGetUnmanagedKey_id: %v", id) - resp, httpRes, err := apiClient.KeyApi.KeyGetUnmanagedKey(context.Background(), id).Execute() + resp, httpRes, err := apiClient.KeyApi.KeyGetUnmanagedKey(context.Background(), id.(int32)).Execute() require.Nil(t, err) require.NotNil(t, resp) diff --git a/api/command/api_license.go b/api/command/api_license.go index 8641200..960e210 100644 --- a/api/command/api_license.go +++ b/api/command/api_license.go @@ -83,9 +83,12 @@ func (a *LicenseApiService) LicenseGetCurrentLicenseExecute(r ApiLicenseGetCurre localVarReturnValue *KeyfactorApiModelsLicenseLicenseResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/License" + localVarPath := apiBasePath + "/License" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} diff --git a/api/command/api_license_test.go b/api/command/api_license_test.go index 899e4ee..c4258d9 100644 --- a/api/command/api_license_test.go +++ b/api/command/api_license_test.go @@ -23,10 +23,13 @@ import ( "context" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "os" "testing" ) func Test_command_LicenseApiService(t *testing.T) { + cwd, _ := os.Getwd() + t.Logf("Working directory: %s", cwd) config := GetEnvConfiguration() configuration, configErr := NewConfiguration(config) diff --git a/api/command/api_logon.go b/api/command/api_logon.go index 7f33fa9..3749622 100644 --- a/api/command/api_logon.go +++ b/api/command/api_logon.go @@ -91,9 +91,12 @@ func (a *LogonApiService) LogonCreateLogonExecute(r ApiLogonCreateLogonRequest) localVarReturnValue *ModelsSSHLogonsLogonResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSH/Logons" + localVarPath := apiBasePath + "/SSH/Logons" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -216,9 +219,12 @@ func (a *LogonApiService) LogonDeleteExecute(r ApiLogonDeleteRequest) (*http.Res formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSH/Logons/{id}" + localVarPath := apiBasePath + "/SSH/Logons/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -331,9 +337,12 @@ func (a *LogonApiService) LogonGetLogonExecute(r ApiLogonGetLogonRequest) (*Mode localVarReturnValue *ModelsSSHLogonsLogonResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSH/Logons/{id}" + localVarPath := apiBasePath + "/SSH/Logons/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -459,9 +468,12 @@ func (a *LogonApiService) LogonLogonAccessExecute(r ApiLogonLogonAccessRequest) localVarReturnValue *ModelsSSHAccessLogonUserAccessResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSH/Logons/Access" + localVarPath := apiBasePath + "/SSH/Logons/Access" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -619,9 +631,12 @@ func (a *LogonApiService) LogonQueryLogonsExecute(r ApiLogonQueryLogonsRequest) localVarReturnValue []ModelsSSHLogonsLogonQueryResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSH/Logons" + localVarPath := apiBasePath + "/SSH/Logons" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} diff --git a/api/command/api_logon_test.go b/api/command/api_logon_test.go index f1f68f3..4c9a141 100644 --- a/api/command/api_logon_test.go +++ b/api/command/api_logon_test.go @@ -23,10 +23,13 @@ import ( "context" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "os" "testing" ) func Test_command_LogonApiService(t *testing.T) { + cwd, _ := os.Getwd() + t.Logf("Working directory: %s", cwd) config := GetEnvConfiguration() configuration, configErr := NewConfiguration(config) @@ -46,9 +49,13 @@ func Test_command_LogonApiService(t *testing.T) { t.Run("Test LogonApiService LogonDelete", func(t *testing.T) { - var id int32 + var id interface{} - httpRes, err := apiClient.LogonApi.LogonDelete(context.Background(), id).Execute() + id = os.Getenv("LogonApi_LogonDelete_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("LogonApi_LogonDelete_id: %v", id) + + httpRes, err := apiClient.LogonApi.LogonDelete(context.Background(), id.(int32)).Execute() require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) @@ -57,9 +64,13 @@ func Test_command_LogonApiService(t *testing.T) { t.Run("Test LogonApiService LogonGetLogon", func(t *testing.T) { - var id int32 + var id interface{} + + id = os.Getenv("LogonApi_LogonGetLogon_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("LogonApi_LogonGetLogon_id: %v", id) - resp, httpRes, err := apiClient.LogonApi.LogonGetLogon(context.Background(), id).Execute() + resp, httpRes, err := apiClient.LogonApi.LogonGetLogon(context.Background(), id.(int32)).Execute() require.Nil(t, err) require.NotNil(t, resp) diff --git a/api/command/api_mac_enrollment.go b/api/command/api_mac_enrollment.go index fc2e2f5..89114eb 100644 --- a/api/command/api_mac_enrollment.go +++ b/api/command/api_mac_enrollment.go @@ -89,9 +89,12 @@ func (a *MacEnrollmentApiService) MacEnrollmentEditMacEnrollmentExecute(r ApiMac localVarReturnValue *KeyfactorApiModelsMacEnrollmentMacEnrollmentAPIModel ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/MacEnrollment" + localVarPath := apiBasePath + "/MacEnrollment" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -214,9 +217,12 @@ func (a *MacEnrollmentApiService) MacEnrollmentMacEnrollmentExecute(r ApiMacEnro localVarReturnValue *KeyfactorApiModelsMacEnrollmentMacEnrollmentAPIModel ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/MacEnrollment" + localVarPath := apiBasePath + "/MacEnrollment" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} diff --git a/api/command/api_mac_enrollment_test.go b/api/command/api_mac_enrollment_test.go index 2930ee0..0a20616 100644 --- a/api/command/api_mac_enrollment_test.go +++ b/api/command/api_mac_enrollment_test.go @@ -23,10 +23,13 @@ import ( "context" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "os" "testing" ) func Test_command_MacEnrollmentApiService(t *testing.T) { + cwd, _ := os.Getwd() + t.Logf("Working directory: %s", cwd) config := GetEnvConfiguration() configuration, configErr := NewConfiguration(config) diff --git a/api/command/api_metadata_field.go b/api/command/api_metadata_field.go index c1faac1..5575ed8 100644 --- a/api/command/api_metadata_field.go +++ b/api/command/api_metadata_field.go @@ -93,9 +93,12 @@ func (a *MetadataFieldApiService) MetadataFieldCreateMetadataFieldExecute(r ApiM localVarReturnValue *KeyfactorApiModelsMetadataFieldMetadataFieldResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/MetadataFields" + localVarPath := apiBasePath + "/MetadataFields" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -225,9 +228,12 @@ func (a *MetadataFieldApiService) MetadataFieldDeleteMetadataFieldExecute(r ApiM formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/MetadataFields/{id}" + localVarPath := apiBasePath + "/MetadataFields/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -353,9 +359,12 @@ func (a *MetadataFieldApiService) MetadataFieldDeleteMetadataFieldsExecute(r Api formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/MetadataFields" + localVarPath := apiBasePath + "/MetadataFields" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -507,9 +516,12 @@ func (a *MetadataFieldApiService) MetadataFieldGetAllMetadataFieldsExecute(r Api localVarReturnValue []ModelsMetadataFieldTypeModel ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/MetadataFields" + localVarPath := apiBasePath + "/MetadataFields" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -645,9 +657,12 @@ func (a *MetadataFieldApiService) MetadataFieldGetMetadataField0Execute(r ApiMet localVarReturnValue *ModelsMetadataFieldTypeModel ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/MetadataFields/{id}" + localVarPath := apiBasePath + "/MetadataFields/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -769,9 +784,12 @@ func (a *MetadataFieldApiService) MetadataFieldGetMetadataField1Execute(r ApiMet localVarReturnValue *ModelsMetadataFieldTypeModel ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/MetadataFields/{name}" + localVarPath := apiBasePath + "/MetadataFields/{name}" localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", url.PathEscape(parameterValueToString(r.name, "name")), -1) localVarHeaderParams := make(map[string]string) @@ -893,9 +911,12 @@ func (a *MetadataFieldApiService) MetadataFieldGetMetadataFieldInUseExecute(r Ap localVarReturnValue bool ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/MetadataFields/{id}/InUse" + localVarPath := apiBasePath + "/MetadataFields/{id}/InUse" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -1023,9 +1044,12 @@ func (a *MetadataFieldApiService) MetadataFieldUpdateMetadataFieldExecute(r ApiM localVarReturnValue *KeyfactorApiModelsMetadataFieldMetadataFieldResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/MetadataFields" + localVarPath := apiBasePath + "/MetadataFields" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} diff --git a/api/command/api_metadata_field_test.go b/api/command/api_metadata_field_test.go index c2bf50a..37b5c61 100644 --- a/api/command/api_metadata_field_test.go +++ b/api/command/api_metadata_field_test.go @@ -23,10 +23,13 @@ import ( "context" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "os" "testing" ) func Test_command_MetadataFieldApiService(t *testing.T) { + cwd, _ := os.Getwd() + t.Logf("Working directory: %s", cwd) config := GetEnvConfiguration() configuration, configErr := NewConfiguration(config) @@ -46,9 +49,13 @@ func Test_command_MetadataFieldApiService(t *testing.T) { t.Run("Test MetadataFieldApiService MetadataFieldDeleteMetadataField", func(t *testing.T) { - var id int32 + var id interface{} - httpRes, err := apiClient.MetadataFieldApi.MetadataFieldDeleteMetadataField(context.Background(), id).Execute() + id = os.Getenv("MetadataFieldApi_MetadataFieldDeleteMetadataField_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("MetadataFieldApi_MetadataFieldDeleteMetadataField_id: %v", id) + + httpRes, err := apiClient.MetadataFieldApi.MetadataFieldDeleteMetadataField(context.Background(), id.(int32)).Execute() require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) @@ -76,9 +83,13 @@ func Test_command_MetadataFieldApiService(t *testing.T) { t.Run("Test MetadataFieldApiService MetadataFieldGetMetadataField0", func(t *testing.T) { - var id int32 + var id interface{} + + id = os.Getenv("MetadataFieldApi_MetadataFieldGetMetadataField0_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("MetadataFieldApi_MetadataFieldGetMetadataField0_id: %v", id) - resp, httpRes, err := apiClient.MetadataFieldApi.MetadataFieldGetMetadataField0(context.Background(), id).Execute() + resp, httpRes, err := apiClient.MetadataFieldApi.MetadataFieldGetMetadataField0(context.Background(), id.(int32)).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -88,9 +99,13 @@ func Test_command_MetadataFieldApiService(t *testing.T) { t.Run("Test MetadataFieldApiService MetadataFieldGetMetadataField1", func(t *testing.T) { - var name string + var name interface{} - resp, httpRes, err := apiClient.MetadataFieldApi.MetadataFieldGetMetadataField1(context.Background(), name).Execute() + name = os.Getenv("MetadataFieldApi_MetadataFieldGetMetadataField1_name") + name, _ = convertParamInterface(name, "string") + t.Logf("MetadataFieldApi_MetadataFieldGetMetadataField1_name: %v", name) + + resp, httpRes, err := apiClient.MetadataFieldApi.MetadataFieldGetMetadataField1(context.Background(), name.(string)).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -100,9 +115,13 @@ func Test_command_MetadataFieldApiService(t *testing.T) { t.Run("Test MetadataFieldApiService MetadataFieldGetMetadataFieldInUse", func(t *testing.T) { - var id int32 + var id interface{} + + id = os.Getenv("MetadataFieldApi_MetadataFieldGetMetadataFieldInUse_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("MetadataFieldApi_MetadataFieldGetMetadataFieldInUse_id: %v", id) - resp, httpRes, err := apiClient.MetadataFieldApi.MetadataFieldGetMetadataFieldInUse(context.Background(), id).Execute() + resp, httpRes, err := apiClient.MetadataFieldApi.MetadataFieldGetMetadataFieldInUse(context.Background(), id.(int32)).Execute() require.Nil(t, err) require.NotNil(t, resp) diff --git a/api/command/api_monitoring.go b/api/command/api_monitoring.go index 372fcb1..f660813 100644 --- a/api/command/api_monitoring.go +++ b/api/command/api_monitoring.go @@ -91,9 +91,12 @@ func (a *MonitoringApiService) MonitoringAddRevocationMonitoringExecute(r ApiMon localVarReturnValue *KeyfactorApiModelsMonitoringRevocationMonitoringDefinitionResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Monitoring/Revocation" + localVarPath := apiBasePath + "/Monitoring/Revocation" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -216,9 +219,12 @@ func (a *MonitoringApiService) MonitoringDeleteRevocationMonitoringExecute(r Api formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Monitoring/Revocation/{id}" + localVarPath := apiBasePath + "/Monitoring/Revocation/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -335,9 +341,12 @@ func (a *MonitoringApiService) MonitoringEditRevocationMonitoringExecute(r ApiMo localVarReturnValue *KeyfactorApiModelsMonitoringRevocationMonitoringDefinitionResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Monitoring/Revocation" + localVarPath := apiBasePath + "/Monitoring/Revocation" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -463,9 +472,12 @@ func (a *MonitoringApiService) MonitoringGetRevocationMonitoringExecute(r ApiMon localVarReturnValue *KeyfactorApiModelsMonitoringRevocationMonitoringDefinitionResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Monitoring/Revocation/{id}" + localVarPath := apiBasePath + "/Monitoring/Revocation/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -619,9 +631,12 @@ func (a *MonitoringApiService) MonitoringGetRevocationMonitoringEndpointsExecute localVarReturnValue []KeyfactorApiModelsMonitoringRevocationMonitoringDefinitionResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Monitoring/Revocation" + localVarPath := apiBasePath + "/Monitoring/Revocation" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -761,9 +776,12 @@ func (a *MonitoringApiService) MonitoringResolveOCSPExecute(r ApiMonitoringResol localVarReturnValue *KeyfactorApiModelsMonitoringOCSPParametersResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Monitoring/ResolveOCSP" + localVarPath := apiBasePath + "/Monitoring/ResolveOCSP" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -893,9 +911,12 @@ func (a *MonitoringApiService) MonitoringTestAllRevocationMonitoringAlertExecute localVarReturnValue *KeyfactorApiModelsMonitoringRevocationMonitoringAlertTestResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Monitoring/Revocation/TestAll" + localVarPath := apiBasePath + "/Monitoring/Revocation/TestAll" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1025,9 +1046,12 @@ func (a *MonitoringApiService) MonitoringTestRevocationMonitoringAlertExecute(r localVarReturnValue *KeyfactorApiModelsMonitoringRevocationMonitoringAlertTestResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Monitoring/Revocation/Test" + localVarPath := apiBasePath + "/Monitoring/Revocation/Test" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} diff --git a/api/command/api_monitoring_test.go b/api/command/api_monitoring_test.go index dfa8fb9..6bbe4c2 100644 --- a/api/command/api_monitoring_test.go +++ b/api/command/api_monitoring_test.go @@ -23,10 +23,13 @@ import ( "context" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "os" "testing" ) func Test_command_MonitoringApiService(t *testing.T) { + cwd, _ := os.Getwd() + t.Logf("Working directory: %s", cwd) config := GetEnvConfiguration() configuration, configErr := NewConfiguration(config) @@ -46,9 +49,13 @@ func Test_command_MonitoringApiService(t *testing.T) { t.Run("Test MonitoringApiService MonitoringDeleteRevocationMonitoring", func(t *testing.T) { - var id int32 + var id interface{} - httpRes, err := apiClient.MonitoringApi.MonitoringDeleteRevocationMonitoring(context.Background(), id).Execute() + id = os.Getenv("MonitoringApi_MonitoringDeleteRevocationMonitoring_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("MonitoringApi_MonitoringDeleteRevocationMonitoring_id: %v", id) + + httpRes, err := apiClient.MonitoringApi.MonitoringDeleteRevocationMonitoring(context.Background(), id.(int32)).Execute() require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) @@ -67,9 +74,13 @@ func Test_command_MonitoringApiService(t *testing.T) { t.Run("Test MonitoringApiService MonitoringGetRevocationMonitoring", func(t *testing.T) { - var id int32 + var id interface{} + + id = os.Getenv("MonitoringApi_MonitoringGetRevocationMonitoring_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("MonitoringApi_MonitoringGetRevocationMonitoring_id: %v", id) - resp, httpRes, err := apiClient.MonitoringApi.MonitoringGetRevocationMonitoring(context.Background(), id).Execute() + resp, httpRes, err := apiClient.MonitoringApi.MonitoringGetRevocationMonitoring(context.Background(), id.(int32)).Execute() require.Nil(t, err) require.NotNil(t, resp) diff --git a/api/command/api_orchestrator_job.go b/api/command/api_orchestrator_job.go index 90e6f08..168bbf7 100644 --- a/api/command/api_orchestrator_job.go +++ b/api/command/api_orchestrator_job.go @@ -87,9 +87,12 @@ func (a *OrchestratorJobApiService) OrchestratorJobAcknowledgeJobsExecute(r ApiO formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/OrchestratorJobs/Acknowledge" + localVarPath := apiBasePath + "/OrchestratorJobs/Acknowledge" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -210,9 +213,12 @@ func (a *OrchestratorJobApiService) OrchestratorJobGetCustomJobResultDataExecute localVarReturnValue *KeyfactorApiModelsOrchestratorJobsCustomJobResultDataResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/OrchestratorJobs/JobStatus/Data" + localVarPath := apiBasePath + "/OrchestratorJobs/JobStatus/Data" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -369,9 +375,12 @@ func (a *OrchestratorJobApiService) OrchestratorJobGetJobHistoryExecute(r ApiOrc localVarReturnValue []KeyfactorApiModelsCertificateStoresJobHistoryResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/OrchestratorJobs/JobHistory" + localVarPath := apiBasePath + "/OrchestratorJobs/JobHistory" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -539,9 +548,12 @@ func (a *OrchestratorJobApiService) OrchestratorJobGetScheduledJobsExecute(r Api localVarReturnValue []ModelsOrchestratorJobsJob ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/OrchestratorJobs/ScheduledJobs" + localVarPath := apiBasePath + "/OrchestratorJobs/ScheduledJobs" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -678,9 +690,12 @@ func (a *OrchestratorJobApiService) OrchestratorJobRescheduleJobsExecute(r ApiOr formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/OrchestratorJobs/Reschedule" + localVarPath := apiBasePath + "/OrchestratorJobs/Reschedule" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -801,9 +816,12 @@ func (a *OrchestratorJobApiService) OrchestratorJobScheduleBulkJobExecute(r ApiO localVarReturnValue *KeyfactorApiModelsOrchestratorJobsBulkJobResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/OrchestratorJobs/Custom/Bulk" + localVarPath := apiBasePath + "/OrchestratorJobs/Custom/Bulk" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -933,9 +951,12 @@ func (a *OrchestratorJobApiService) OrchestratorJobScheduleJobExecute(r ApiOrche localVarReturnValue *KeyfactorApiModelsOrchestratorJobsJobResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/OrchestratorJobs/Custom" + localVarPath := apiBasePath + "/OrchestratorJobs/Custom" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1062,9 +1083,12 @@ func (a *OrchestratorJobApiService) OrchestratorJobUnscheduleJobsExecute(r ApiOr formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/OrchestratorJobs/Unschedule" + localVarPath := apiBasePath + "/OrchestratorJobs/Unschedule" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} diff --git a/api/command/api_orchestrator_job_test.go b/api/command/api_orchestrator_job_test.go index 3a26c52..0458759 100644 --- a/api/command/api_orchestrator_job_test.go +++ b/api/command/api_orchestrator_job_test.go @@ -23,10 +23,13 @@ import ( "context" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "os" "testing" ) func Test_command_OrchestratorJobApiService(t *testing.T) { + cwd, _ := os.Getwd() + t.Logf("Working directory: %s", cwd) config := GetEnvConfiguration() configuration, configErr := NewConfiguration(config) diff --git a/api/command/api_pam_provider.go b/api/command/api_pam_provider.go index d85869a..f530ea0 100644 --- a/api/command/api_pam_provider.go +++ b/api/command/api_pam_provider.go @@ -97,9 +97,12 @@ func (a *PAMProviderApiService) PAMProviderCreatePamProviderExecute(r ApiPAMProv localVarReturnValue *CSSCMSDataModelModelsProvider ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/PamProviders" + localVarPath := apiBasePath + "/PamProviders" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -235,9 +238,12 @@ func (a *PAMProviderApiService) PAMProviderCreatePamProviderTypeExecute(r ApiPAM localVarReturnValue *KeyfactorApiPAMProviderTypeResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/PamProviders/Types" + localVarPath := apiBasePath + "/PamProviders/Types" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -360,9 +366,12 @@ func (a *PAMProviderApiService) PAMProviderDeletePamProviderExecute(r ApiPAMProv formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/PamProviders/{id}" + localVarPath := apiBasePath + "/PamProviders/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -481,9 +490,12 @@ func (a *PAMProviderApiService) PAMProviderGetPamProviderExecute(r ApiPAMProvide localVarReturnValue *CSSCMSDataModelModelsProvider ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/PamProviders/{id}" + localVarPath := apiBasePath + "/PamProviders/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -608,9 +620,12 @@ func (a *PAMProviderApiService) PAMProviderGetPamProviderTypesExecute(r ApiPAMPr localVarReturnValue []CSSCMSDataModelModelsProviderType ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/PamProviders/Types" + localVarPath := apiBasePath + "/PamProviders/Types" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -769,9 +784,12 @@ func (a *PAMProviderApiService) PAMProviderGetPamProvidersExecute(r ApiPAMProvid localVarReturnValue []CSSCMSDataModelModelsProvider ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/PamProviders" + localVarPath := apiBasePath + "/PamProviders" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -917,9 +935,12 @@ func (a *PAMProviderApiService) PAMProviderUpdatePamProviderExecute(r ApiPAMProv localVarReturnValue *CSSCMSDataModelModelsProvider ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/PamProviders" + localVarPath := apiBasePath + "/PamProviders" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} diff --git a/api/command/api_pam_provider_test.go b/api/command/api_pam_provider_test.go index 156de58..f989b91 100644 --- a/api/command/api_pam_provider_test.go +++ b/api/command/api_pam_provider_test.go @@ -23,10 +23,13 @@ import ( "context" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "os" "testing" ) func Test_command_PAMProviderApiService(t *testing.T) { + cwd, _ := os.Getwd() + t.Logf("Working directory: %s", cwd) config := GetEnvConfiguration() configuration, configErr := NewConfiguration(config) @@ -56,9 +59,13 @@ func Test_command_PAMProviderApiService(t *testing.T) { t.Run("Test PAMProviderApiService PAMProviderDeletePamProvider", func(t *testing.T) { - var id int32 + var id interface{} - httpRes, err := apiClient.PAMProviderApi.PAMProviderDeletePamProvider(context.Background(), id).Execute() + id = os.Getenv("PAMProviderApi_PAMProviderDeletePamProvider_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("PAMProviderApi_PAMProviderDeletePamProvider_id: %v", id) + + httpRes, err := apiClient.PAMProviderApi.PAMProviderDeletePamProvider(context.Background(), id.(int32)).Execute() require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) @@ -67,9 +74,13 @@ func Test_command_PAMProviderApiService(t *testing.T) { t.Run("Test PAMProviderApiService PAMProviderGetPamProvider", func(t *testing.T) { - var id int32 + var id interface{} + + id = os.Getenv("PAMProviderApi_PAMProviderGetPamProvider_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("PAMProviderApi_PAMProviderGetPamProvider_id: %v", id) - resp, httpRes, err := apiClient.PAMProviderApi.PAMProviderGetPamProvider(context.Background(), id).Execute() + resp, httpRes, err := apiClient.PAMProviderApi.PAMProviderGetPamProvider(context.Background(), id.(int32)).Execute() require.Nil(t, err) require.NotNil(t, resp) diff --git a/api/command/api_pending_alert.go b/api/command/api_pending_alert.go index d8680ad..000389a 100644 --- a/api/command/api_pending_alert.go +++ b/api/command/api_pending_alert.go @@ -91,9 +91,12 @@ func (a *PendingAlertApiService) PendingAlertAddPendingAlertExecute(r ApiPending localVarReturnValue *KeyfactorApiModelsAlertsPendingPendingAlertDefinitionResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Alerts/Pending" + localVarPath := apiBasePath + "/Alerts/Pending" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -216,9 +219,12 @@ func (a *PendingAlertApiService) PendingAlertDeletePendingAlertExecute(r ApiPend formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Alerts/Pending/{id}" + localVarPath := apiBasePath + "/Alerts/Pending/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -335,9 +341,12 @@ func (a *PendingAlertApiService) PendingAlertEditPendingAlertExecute(r ApiPendin localVarReturnValue *KeyfactorApiModelsAlertsPendingPendingAlertDefinitionResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Alerts/Pending" + localVarPath := apiBasePath + "/Alerts/Pending" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -466,9 +475,12 @@ func (a *PendingAlertApiService) PendingAlertEditScheduleExecute(r ApiPendingAle localVarReturnValue *KeyfactorApiModelsAlertsAlertScheduleAlertScheduleResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Alerts/Pending/Schedule" + localVarPath := apiBasePath + "/Alerts/Pending/Schedule" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -594,9 +606,12 @@ func (a *PendingAlertApiService) PendingAlertGetPendingAlertExecute(r ApiPending localVarReturnValue *KeyfactorApiModelsAlertsPendingPendingAlertDefinitionResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Alerts/Pending/{id}" + localVarPath := apiBasePath + "/Alerts/Pending/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -750,9 +765,12 @@ func (a *PendingAlertApiService) PendingAlertGetPendingAlertsExecute(r ApiPendin localVarReturnValue []KeyfactorApiModelsAlertsPendingPendingAlertDefinitionResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Alerts/Pending" + localVarPath := apiBasePath + "/Alerts/Pending" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -885,9 +903,12 @@ func (a *PendingAlertApiService) PendingAlertGetScheduleExecute(r ApiPendingAler localVarReturnValue *KeyfactorApiModelsAlertsAlertScheduleAlertScheduleResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Alerts/Pending/Schedule" + localVarPath := apiBasePath + "/Alerts/Pending/Schedule" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1012,9 +1033,12 @@ func (a *PendingAlertApiService) PendingAlertTestAllPendingAlertExecute(r ApiPen localVarReturnValue *KeyfactorApiModelsAlertsPendingPendingAlertTestResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Alerts/Pending/TestAll" + localVarPath := apiBasePath + "/Alerts/Pending/TestAll" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1144,9 +1168,12 @@ func (a *PendingAlertApiService) PendingAlertTestPendingAlertExecute(r ApiPendin localVarReturnValue *KeyfactorApiModelsAlertsPendingPendingAlertTestResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Alerts/Pending/Test" + localVarPath := apiBasePath + "/Alerts/Pending/Test" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} diff --git a/api/command/api_pending_alert_test.go b/api/command/api_pending_alert_test.go index 5840599..b804e8f 100644 --- a/api/command/api_pending_alert_test.go +++ b/api/command/api_pending_alert_test.go @@ -23,10 +23,13 @@ import ( "context" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "os" "testing" ) func Test_command_PendingAlertApiService(t *testing.T) { + cwd, _ := os.Getwd() + t.Logf("Working directory: %s", cwd) config := GetEnvConfiguration() configuration, configErr := NewConfiguration(config) @@ -46,9 +49,13 @@ func Test_command_PendingAlertApiService(t *testing.T) { t.Run("Test PendingAlertApiService PendingAlertDeletePendingAlert", func(t *testing.T) { - var id int32 + var id interface{} - httpRes, err := apiClient.PendingAlertApi.PendingAlertDeletePendingAlert(context.Background(), id).Execute() + id = os.Getenv("PendingAlertApi_PendingAlertDeletePendingAlert_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("PendingAlertApi_PendingAlertDeletePendingAlert_id: %v", id) + + httpRes, err := apiClient.PendingAlertApi.PendingAlertDeletePendingAlert(context.Background(), id.(int32)).Execute() require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) @@ -77,9 +84,13 @@ func Test_command_PendingAlertApiService(t *testing.T) { t.Run("Test PendingAlertApiService PendingAlertGetPendingAlert", func(t *testing.T) { - var id int32 + var id interface{} + + id = os.Getenv("PendingAlertApi_PendingAlertGetPendingAlert_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("PendingAlertApi_PendingAlertGetPendingAlert_id: %v", id) - resp, httpRes, err := apiClient.PendingAlertApi.PendingAlertGetPendingAlert(context.Background(), id).Execute() + resp, httpRes, err := apiClient.PendingAlertApi.PendingAlertGetPendingAlert(context.Background(), id.(int32)).Execute() require.Nil(t, err) require.NotNil(t, resp) diff --git a/api/command/api_reports.go b/api/command/api_reports.go index 761ba9d..4c61be9 100644 --- a/api/command/api_reports.go +++ b/api/command/api_reports.go @@ -91,9 +91,12 @@ func (a *ReportsApiService) ReportsCreateCustomReportExecute(r ApiReportsCreateC localVarReturnValue *ModelsCustomReport ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Reports/Custom" + localVarPath := apiBasePath + "/Reports/Custom" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -226,9 +229,12 @@ func (a *ReportsApiService) ReportsCreateReportScheduleExecute(r ApiReportsCreat localVarReturnValue *ModelsReportSchedule ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Reports/{id}/Schedules" + localVarPath := apiBasePath + "/Reports/{id}/Schedules" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -352,9 +358,12 @@ func (a *ReportsApiService) ReportsDeleteReportExecute(r ApiReportsDeleteReportR formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Reports/Custom/{id}" + localVarPath := apiBasePath + "/Reports/Custom/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -464,9 +473,12 @@ func (a *ReportsApiService) ReportsDeleteReportScheduleExecute(r ApiReportsDelet formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Reports/Schedules/{id}" + localVarPath := apiBasePath + "/Reports/Schedules/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -579,9 +591,12 @@ func (a *ReportsApiService) ReportsGetCustomReportExecute(r ApiReportsGetCustomR localVarReturnValue *ModelsCustomReport ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Reports/Custom/{id}" + localVarPath := apiBasePath + "/Reports/Custom/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -703,9 +718,12 @@ func (a *ReportsApiService) ReportsGetReportExecute(r ApiReportsGetReportRequest localVarReturnValue *ModelsReport ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Reports/{id}" + localVarPath := apiBasePath + "/Reports/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -827,9 +845,12 @@ func (a *ReportsApiService) ReportsGetReportParametersExecute(r ApiReportsGetRep localVarReturnValue []ModelsReportParameters ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Reports/{id}/Parameters" + localVarPath := apiBasePath + "/Reports/{id}/Parameters" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -951,9 +972,12 @@ func (a *ReportsApiService) ReportsGetReportScheduleExecute(r ApiReportsGetRepor localVarReturnValue *ModelsReportSchedule ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Reports/Schedules/{id}" + localVarPath := apiBasePath + "/Reports/Schedules/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -1110,9 +1134,12 @@ func (a *ReportsApiService) ReportsGetReportSchedulesExecute(r ApiReportsGetRepo localVarReturnValue []ModelsReportSchedule ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Reports/{id}/Schedules" + localVarPath := apiBasePath + "/Reports/{id}/Schedules" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -1281,9 +1308,12 @@ func (a *ReportsApiService) ReportsQueryCustomReportsExecute(r ApiReportsQueryCu localVarReturnValue []ModelsCustomReport ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Reports/Custom" + localVarPath := apiBasePath + "/Reports/Custom" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1451,9 +1481,12 @@ func (a *ReportsApiService) ReportsQueryReportsExecute(r ApiReportsQueryReportsR localVarReturnValue []ModelsReport ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Reports" + localVarPath := apiBasePath + "/Reports" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1593,9 +1626,12 @@ func (a *ReportsApiService) ReportsUpdateCustomReportExecute(r ApiReportsUpdateC localVarReturnValue *ModelsCustomReport ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Reports/Custom" + localVarPath := apiBasePath + "/Reports/Custom" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1725,9 +1761,12 @@ func (a *ReportsApiService) ReportsUpdateReportExecute(r ApiReportsUpdateReportR localVarReturnValue *ModelsReport ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Reports" + localVarPath := apiBasePath + "/Reports" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1860,9 +1899,12 @@ func (a *ReportsApiService) ReportsUpdateReportParametersExecute(r ApiReportsUpd localVarReturnValue []ModelsReportParameters ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Reports/{id}/Parameters" + localVarPath := apiBasePath + "/Reports/{id}/Parameters" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -1996,9 +2038,12 @@ func (a *ReportsApiService) ReportsUpdateReportScheduleExecute(r ApiReportsUpdat localVarReturnValue *ModelsReportSchedule ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Reports/{id}/Schedules" + localVarPath := apiBasePath + "/Reports/{id}/Schedules" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) diff --git a/api/command/api_reports_test.go b/api/command/api_reports_test.go index c9b77b8..bd260d4 100644 --- a/api/command/api_reports_test.go +++ b/api/command/api_reports_test.go @@ -23,10 +23,13 @@ import ( "context" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "os" "testing" ) func Test_command_ReportsApiService(t *testing.T) { + cwd, _ := os.Getwd() + t.Logf("Working directory: %s", cwd) config := GetEnvConfiguration() configuration, configErr := NewConfiguration(config) @@ -46,9 +49,13 @@ func Test_command_ReportsApiService(t *testing.T) { t.Run("Test ReportsApiService ReportsCreateReportSchedule", func(t *testing.T) { - var id int32 + var id interface{} - resp, httpRes, err := apiClient.ReportsApi.ReportsCreateReportSchedule(context.Background(), id).Execute() + id = os.Getenv("ReportsApi_ReportsCreateReportSchedule_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("ReportsApi_ReportsCreateReportSchedule_id: %v", id) + + resp, httpRes, err := apiClient.ReportsApi.ReportsCreateReportSchedule(context.Background(), id.(int32)).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -58,9 +65,13 @@ func Test_command_ReportsApiService(t *testing.T) { t.Run("Test ReportsApiService ReportsDeleteReport", func(t *testing.T) { - var id int32 + var id interface{} + + id = os.Getenv("ReportsApi_ReportsDeleteReport_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("ReportsApi_ReportsDeleteReport_id: %v", id) - httpRes, err := apiClient.ReportsApi.ReportsDeleteReport(context.Background(), id).Execute() + httpRes, err := apiClient.ReportsApi.ReportsDeleteReport(context.Background(), id.(int32)).Execute() require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) @@ -69,9 +80,13 @@ func Test_command_ReportsApiService(t *testing.T) { t.Run("Test ReportsApiService ReportsDeleteReportSchedule", func(t *testing.T) { - var id int32 + var id interface{} + + id = os.Getenv("ReportsApi_ReportsDeleteReportSchedule_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("ReportsApi_ReportsDeleteReportSchedule_id: %v", id) - httpRes, err := apiClient.ReportsApi.ReportsDeleteReportSchedule(context.Background(), id).Execute() + httpRes, err := apiClient.ReportsApi.ReportsDeleteReportSchedule(context.Background(), id.(int32)).Execute() require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) @@ -80,9 +95,13 @@ func Test_command_ReportsApiService(t *testing.T) { t.Run("Test ReportsApiService ReportsGetCustomReport", func(t *testing.T) { - var id int32 + var id interface{} - resp, httpRes, err := apiClient.ReportsApi.ReportsGetCustomReport(context.Background(), id).Execute() + id = os.Getenv("ReportsApi_ReportsGetCustomReport_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("ReportsApi_ReportsGetCustomReport_id: %v", id) + + resp, httpRes, err := apiClient.ReportsApi.ReportsGetCustomReport(context.Background(), id.(int32)).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -92,9 +111,13 @@ func Test_command_ReportsApiService(t *testing.T) { t.Run("Test ReportsApiService ReportsGetReport", func(t *testing.T) { - var id int32 + var id interface{} + + id = os.Getenv("ReportsApi_ReportsGetReport_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("ReportsApi_ReportsGetReport_id: %v", id) - resp, httpRes, err := apiClient.ReportsApi.ReportsGetReport(context.Background(), id).Execute() + resp, httpRes, err := apiClient.ReportsApi.ReportsGetReport(context.Background(), id.(int32)).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -104,9 +127,13 @@ func Test_command_ReportsApiService(t *testing.T) { t.Run("Test ReportsApiService ReportsGetReportParameters", func(t *testing.T) { - var id int32 + var id interface{} - resp, httpRes, err := apiClient.ReportsApi.ReportsGetReportParameters(context.Background(), id).Execute() + id = os.Getenv("ReportsApi_ReportsGetReportParameters_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("ReportsApi_ReportsGetReportParameters_id: %v", id) + + resp, httpRes, err := apiClient.ReportsApi.ReportsGetReportParameters(context.Background(), id.(int32)).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -116,9 +143,13 @@ func Test_command_ReportsApiService(t *testing.T) { t.Run("Test ReportsApiService ReportsGetReportSchedule", func(t *testing.T) { - var id int32 + var id interface{} + + id = os.Getenv("ReportsApi_ReportsGetReportSchedule_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("ReportsApi_ReportsGetReportSchedule_id: %v", id) - resp, httpRes, err := apiClient.ReportsApi.ReportsGetReportSchedule(context.Background(), id).Execute() + resp, httpRes, err := apiClient.ReportsApi.ReportsGetReportSchedule(context.Background(), id.(int32)).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -128,9 +159,13 @@ func Test_command_ReportsApiService(t *testing.T) { t.Run("Test ReportsApiService ReportsGetReportSchedules", func(t *testing.T) { - var id int32 + var id interface{} + + id = os.Getenv("ReportsApi_ReportsGetReportSchedules_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("ReportsApi_ReportsGetReportSchedules_id: %v", id) - resp, httpRes, err := apiClient.ReportsApi.ReportsGetReportSchedules(context.Background(), id).Execute() + resp, httpRes, err := apiClient.ReportsApi.ReportsGetReportSchedules(context.Background(), id.(int32)).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -180,9 +215,13 @@ func Test_command_ReportsApiService(t *testing.T) { t.Run("Test ReportsApiService ReportsUpdateReportParameters", func(t *testing.T) { - var id int32 + var id interface{} - resp, httpRes, err := apiClient.ReportsApi.ReportsUpdateReportParameters(context.Background(), id).Execute() + id = os.Getenv("ReportsApi_ReportsUpdateReportParameters_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("ReportsApi_ReportsUpdateReportParameters_id: %v", id) + + resp, httpRes, err := apiClient.ReportsApi.ReportsUpdateReportParameters(context.Background(), id.(int32)).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -192,9 +231,13 @@ func Test_command_ReportsApiService(t *testing.T) { t.Run("Test ReportsApiService ReportsUpdateReportSchedule", func(t *testing.T) { - var id int32 + var id interface{} + + id = os.Getenv("ReportsApi_ReportsUpdateReportSchedule_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("ReportsApi_ReportsUpdateReportSchedule_id: %v", id) - resp, httpRes, err := apiClient.ReportsApi.ReportsUpdateReportSchedule(context.Background(), id).Execute() + resp, httpRes, err := apiClient.ReportsApi.ReportsUpdateReportSchedule(context.Background(), id.(int32)).Execute() require.Nil(t, err) require.NotNil(t, resp) diff --git a/api/command/api_security.go b/api/command/api_security.go index 5b032cd..719fabe 100644 --- a/api/command/api_security.go +++ b/api/command/api_security.go @@ -84,9 +84,12 @@ func (a *SecurityApiService) SecurityDeleteSecurityIdentityExecute(r ApiSecurity formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Security/Identities/{id}" + localVarPath := apiBasePath + "/Security/Identities/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -199,9 +202,12 @@ func (a *SecurityApiService) SecurityIdentityPermissionsExecute(r ApiSecurityIde localVarReturnValue *ModelsSecurityIdentitiesSecurityIdentityPermissionsResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Security/Identities/{id}" + localVarPath := apiBasePath + "/Security/Identities/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -327,9 +333,12 @@ func (a *SecurityApiService) SecurityLookupIdentityExecute(r ApiSecurityLookupId localVarReturnValue *ModelsSecurityIdentitiesSecurityIdentityLookupResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Security/Identities/Lookup" + localVarPath := apiBasePath + "/Security/Identities/Lookup" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} diff --git a/api/command/api_security_role_permissions.go b/api/command/api_security_role_permissions.go index 2e563f4..d7e9a35 100644 --- a/api/command/api_security_role_permissions.go +++ b/api/command/api_security_role_permissions.go @@ -103,9 +103,12 @@ func (a *SecurityRolePermissionsApiService) SecurityRolePermissionsAddCollection localVarReturnValue []KeyfactorApiModelsSecurityRolesIdentitiesSecurityRolesCollectionPermissionResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Security/Roles/{id}/Permissions/Collections" + localVarPath := apiBasePath + "/Security/Roles/{id}/Permissions/Collections" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -246,9 +249,12 @@ func (a *SecurityRolePermissionsApiService) SecurityRolePermissionsAddContainerP localVarReturnValue []KeyfactorApiModelsSecurityRolesContainerPermissionResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Security/Roles/{id}/Permissions/Containers" + localVarPath := apiBasePath + "/Security/Roles/{id}/Permissions/Containers" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -447,9 +453,12 @@ func (a *SecurityRolePermissionsApiService) SecurityRolePermissionsAddGlobalPerm localVarReturnValue []KeyfactorApiModelsSecurityRolesIdentitiesSecurityRolesGlobalPermissionResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Security/Roles/{id}/Permissions/Global" + localVarPath := apiBasePath + "/Security/Roles/{id}/Permissions/Global" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -576,9 +585,12 @@ func (a *SecurityRolePermissionsApiService) SecurityRolePermissionsGetCollection localVarReturnValue []KeyfactorApiModelsSecurityRolesIdentitiesSecurityRolesCollectionPermissionResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Security/Roles/{id}/Permissions/Collections" + localVarPath := apiBasePath + "/Security/Roles/{id}/Permissions/Collections" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -700,9 +712,12 @@ func (a *SecurityRolePermissionsApiService) SecurityRolePermissionsGetContainerP localVarReturnValue []KeyfactorApiModelsSecurityRolesContainerPermissionResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Security/Roles/{id}/Permissions/Containers" + localVarPath := apiBasePath + "/Security/Roles/{id}/Permissions/Containers" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -824,9 +839,12 @@ func (a *SecurityRolePermissionsApiService) SecurityRolePermissionsGetGlobalPerm localVarReturnValue []KeyfactorApiModelsSecurityRolesIdentitiesSecurityRolesGlobalPermissionResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Security/Roles/{id}/Permissions/Global" + localVarPath := apiBasePath + "/Security/Roles/{id}/Permissions/Global" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -948,9 +966,12 @@ func (a *SecurityRolePermissionsApiService) SecurityRolePermissionsGetPermission localVarReturnValue []KeyfactorApiModelsSecurityRolesAreaPermissionResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Security/Roles/{id}/Permissions" + localVarPath := apiBasePath + "/Security/Roles/{id}/Permissions" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -1088,9 +1109,12 @@ func (a *SecurityRolePermissionsApiService) SecurityRolePermissionsSetCollection localVarReturnValue []KeyfactorApiModelsSecurityRolesIdentitiesSecurityRolesCollectionPermissionResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Security/Roles/{id}/Permissions/Collections" + localVarPath := apiBasePath + "/Security/Roles/{id}/Permissions/Collections" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -1231,9 +1255,12 @@ func (a *SecurityRolePermissionsApiService) SecurityRolePermissionsSetContainerP localVarReturnValue []KeyfactorApiModelsSecurityRolesContainerPermissionResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Security/Roles/{id}/Permissions/Containers" + localVarPath := apiBasePath + "/Security/Roles/{id}/Permissions/Containers" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -1432,9 +1459,12 @@ func (a *SecurityRolePermissionsApiService) SecurityRolePermissionsSetGlobalPerm localVarReturnValue []KeyfactorApiModelsSecurityRolesIdentitiesSecurityRolesGlobalPermissionResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Security/Roles/{id}/Permissions/Global" + localVarPath := apiBasePath + "/Security/Roles/{id}/Permissions/Global" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) diff --git a/api/command/api_security_role_permissions_test.go b/api/command/api_security_role_permissions_test.go index c4d4427..e72c5f0 100644 --- a/api/command/api_security_role_permissions_test.go +++ b/api/command/api_security_role_permissions_test.go @@ -23,10 +23,13 @@ import ( "context" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "os" "testing" ) func Test_command_SecurityRolePermissionsApiService(t *testing.T) { + cwd, _ := os.Getwd() + t.Logf("Working directory: %s", cwd) config := GetEnvConfiguration() configuration, configErr := NewConfiguration(config) @@ -36,9 +39,13 @@ func Test_command_SecurityRolePermissionsApiService(t *testing.T) { t.Run("Test SecurityRolePermissionsApiService SecurityRolePermissionsAddCollectionPermissions", func(t *testing.T) { - var id int32 + var id interface{} - resp, httpRes, err := apiClient.SecurityRolePermissionsApi.SecurityRolePermissionsAddCollectionPermissions(context.Background(), id).Execute() + id = os.Getenv("SecurityRolePermissionsApi_SecurityRolePermissionsAddCollectionPermissions_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("SecurityRolePermissionsApi_SecurityRolePermissionsAddCollectionPermissions_id: %v", id) + + resp, httpRes, err := apiClient.SecurityRolePermissionsApi.SecurityRolePermissionsAddCollectionPermissions(context.Background(), id.(int32)).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -48,9 +55,13 @@ func Test_command_SecurityRolePermissionsApiService(t *testing.T) { t.Run("Test SecurityRolePermissionsApiService SecurityRolePermissionsAddContainerPermissions", func(t *testing.T) { - var id int32 + var id interface{} + + id = os.Getenv("SecurityRolePermissionsApi_SecurityRolePermissionsAddContainerPermissions_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("SecurityRolePermissionsApi_SecurityRolePermissionsAddContainerPermissions_id: %v", id) - resp, httpRes, err := apiClient.SecurityRolePermissionsApi.SecurityRolePermissionsAddContainerPermissions(context.Background(), id).Execute() + resp, httpRes, err := apiClient.SecurityRolePermissionsApi.SecurityRolePermissionsAddContainerPermissions(context.Background(), id.(int32)).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -60,9 +71,13 @@ func Test_command_SecurityRolePermissionsApiService(t *testing.T) { t.Run("Test SecurityRolePermissionsApiService SecurityRolePermissionsAddGlobalPermissions", func(t *testing.T) { - var id int32 + var id interface{} + + id = os.Getenv("SecurityRolePermissionsApi_SecurityRolePermissionsAddGlobalPermissions_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("SecurityRolePermissionsApi_SecurityRolePermissionsAddGlobalPermissions_id: %v", id) - resp, httpRes, err := apiClient.SecurityRolePermissionsApi.SecurityRolePermissionsAddGlobalPermissions(context.Background(), id).Execute() + resp, httpRes, err := apiClient.SecurityRolePermissionsApi.SecurityRolePermissionsAddGlobalPermissions(context.Background(), id.(int32)).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -72,9 +87,13 @@ func Test_command_SecurityRolePermissionsApiService(t *testing.T) { t.Run("Test SecurityRolePermissionsApiService SecurityRolePermissionsGetCollectionPermissionsForRole", func(t *testing.T) { - var id int32 + var id interface{} - resp, httpRes, err := apiClient.SecurityRolePermissionsApi.SecurityRolePermissionsGetCollectionPermissionsForRole(context.Background(), id).Execute() + id = os.Getenv("SecurityRolePermissionsApi_SecurityRolePermissionsGetCollectionPermissionsForRole_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("SecurityRolePermissionsApi_SecurityRolePermissionsGetCollectionPermissionsForRole_id: %v", id) + + resp, httpRes, err := apiClient.SecurityRolePermissionsApi.SecurityRolePermissionsGetCollectionPermissionsForRole(context.Background(), id.(int32)).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -84,9 +103,13 @@ func Test_command_SecurityRolePermissionsApiService(t *testing.T) { t.Run("Test SecurityRolePermissionsApiService SecurityRolePermissionsGetContainerPermissionsForRole", func(t *testing.T) { - var id int32 + var id interface{} + + id = os.Getenv("SecurityRolePermissionsApi_SecurityRolePermissionsGetContainerPermissionsForRole_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("SecurityRolePermissionsApi_SecurityRolePermissionsGetContainerPermissionsForRole_id: %v", id) - resp, httpRes, err := apiClient.SecurityRolePermissionsApi.SecurityRolePermissionsGetContainerPermissionsForRole(context.Background(), id).Execute() + resp, httpRes, err := apiClient.SecurityRolePermissionsApi.SecurityRolePermissionsGetContainerPermissionsForRole(context.Background(), id.(int32)).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -96,9 +119,13 @@ func Test_command_SecurityRolePermissionsApiService(t *testing.T) { t.Run("Test SecurityRolePermissionsApiService SecurityRolePermissionsGetGlobalPermissionsForRole", func(t *testing.T) { - var id int32 + var id interface{} - resp, httpRes, err := apiClient.SecurityRolePermissionsApi.SecurityRolePermissionsGetGlobalPermissionsForRole(context.Background(), id).Execute() + id = os.Getenv("SecurityRolePermissionsApi_SecurityRolePermissionsGetGlobalPermissionsForRole_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("SecurityRolePermissionsApi_SecurityRolePermissionsGetGlobalPermissionsForRole_id: %v", id) + + resp, httpRes, err := apiClient.SecurityRolePermissionsApi.SecurityRolePermissionsGetGlobalPermissionsForRole(context.Background(), id.(int32)).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -108,9 +135,13 @@ func Test_command_SecurityRolePermissionsApiService(t *testing.T) { t.Run("Test SecurityRolePermissionsApiService SecurityRolePermissionsGetPermissionsForRole", func(t *testing.T) { - var id int32 + var id interface{} + + id = os.Getenv("SecurityRolePermissionsApi_SecurityRolePermissionsGetPermissionsForRole_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("SecurityRolePermissionsApi_SecurityRolePermissionsGetPermissionsForRole_id: %v", id) - resp, httpRes, err := apiClient.SecurityRolePermissionsApi.SecurityRolePermissionsGetPermissionsForRole(context.Background(), id).Execute() + resp, httpRes, err := apiClient.SecurityRolePermissionsApi.SecurityRolePermissionsGetPermissionsForRole(context.Background(), id.(int32)).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -120,9 +151,13 @@ func Test_command_SecurityRolePermissionsApiService(t *testing.T) { t.Run("Test SecurityRolePermissionsApiService SecurityRolePermissionsSetCollectionPermissions", func(t *testing.T) { - var id int32 + var id interface{} + + id = os.Getenv("SecurityRolePermissionsApi_SecurityRolePermissionsSetCollectionPermissions_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("SecurityRolePermissionsApi_SecurityRolePermissionsSetCollectionPermissions_id: %v", id) - resp, httpRes, err := apiClient.SecurityRolePermissionsApi.SecurityRolePermissionsSetCollectionPermissions(context.Background(), id).Execute() + resp, httpRes, err := apiClient.SecurityRolePermissionsApi.SecurityRolePermissionsSetCollectionPermissions(context.Background(), id.(int32)).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -132,9 +167,13 @@ func Test_command_SecurityRolePermissionsApiService(t *testing.T) { t.Run("Test SecurityRolePermissionsApiService SecurityRolePermissionsSetContainerPermissions", func(t *testing.T) { - var id int32 + var id interface{} - resp, httpRes, err := apiClient.SecurityRolePermissionsApi.SecurityRolePermissionsSetContainerPermissions(context.Background(), id).Execute() + id = os.Getenv("SecurityRolePermissionsApi_SecurityRolePermissionsSetContainerPermissions_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("SecurityRolePermissionsApi_SecurityRolePermissionsSetContainerPermissions_id: %v", id) + + resp, httpRes, err := apiClient.SecurityRolePermissionsApi.SecurityRolePermissionsSetContainerPermissions(context.Background(), id.(int32)).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -144,9 +183,13 @@ func Test_command_SecurityRolePermissionsApiService(t *testing.T) { t.Run("Test SecurityRolePermissionsApiService SecurityRolePermissionsSetGlobalPermissions", func(t *testing.T) { - var id int32 + var id interface{} + + id = os.Getenv("SecurityRolePermissionsApi_SecurityRolePermissionsSetGlobalPermissions_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("SecurityRolePermissionsApi_SecurityRolePermissionsSetGlobalPermissions_id: %v", id) - resp, httpRes, err := apiClient.SecurityRolePermissionsApi.SecurityRolePermissionsSetGlobalPermissions(context.Background(), id).Execute() + resp, httpRes, err := apiClient.SecurityRolePermissionsApi.SecurityRolePermissionsSetGlobalPermissions(context.Background(), id.(int32)).Execute() require.Nil(t, err) require.NotNil(t, resp) diff --git a/api/command/api_security_roles.go b/api/command/api_security_roles.go index dc7cc63..2c489cb 100644 --- a/api/command/api_security_roles.go +++ b/api/command/api_security_roles.go @@ -84,9 +84,12 @@ func (a *SecurityRolesApiService) SecurityRolesDeleteSecurityRoleExecute(r ApiSe formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Security/Roles/{id}" + localVarPath := apiBasePath + "/Security/Roles/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -199,9 +202,12 @@ func (a *SecurityRolesApiService) SecurityRolesGetIdentitiesWithRoleExecute(r Ap localVarReturnValue []KeyfactorApiModelsSecurityRolesRoleIdentitiesResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Security/Roles/{id}/Identities" + localVarPath := apiBasePath + "/Security/Roles/{id}/Identities" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -330,9 +336,12 @@ func (a *SecurityRolesApiService) SecurityRolesUpdateIdentitiesWithRoleExecute(r localVarReturnValue []KeyfactorApiModelsSecurityRolesRoleIdentitiesResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Security/Roles/{id}/Identities" + localVarPath := apiBasePath + "/Security/Roles/{id}/Identities" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) diff --git a/api/command/api_security_roles_test.go b/api/command/api_security_roles_test.go index 68f0b43..e2c582a 100644 --- a/api/command/api_security_roles_test.go +++ b/api/command/api_security_roles_test.go @@ -23,10 +23,13 @@ import ( "context" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "os" "testing" ) func Test_command_SecurityRolesApiService(t *testing.T) { + cwd, _ := os.Getwd() + t.Logf("Working directory: %s", cwd) config := GetEnvConfiguration() configuration, configErr := NewConfiguration(config) @@ -36,9 +39,13 @@ func Test_command_SecurityRolesApiService(t *testing.T) { t.Run("Test SecurityRolesApiService SecurityRolesDeleteSecurityRole", func(t *testing.T) { - var id int32 + var id interface{} - httpRes, err := apiClient.SecurityRolesApi.SecurityRolesDeleteSecurityRole(context.Background(), id).Execute() + id = os.Getenv("SecurityRolesApi_SecurityRolesDeleteSecurityRole_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("SecurityRolesApi_SecurityRolesDeleteSecurityRole_id: %v", id) + + httpRes, err := apiClient.SecurityRolesApi.SecurityRolesDeleteSecurityRole(context.Background(), id.(int32)).Execute() require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) @@ -47,9 +54,13 @@ func Test_command_SecurityRolesApiService(t *testing.T) { t.Run("Test SecurityRolesApiService SecurityRolesGetIdentitiesWithRole", func(t *testing.T) { - var id int32 + var id interface{} + + id = os.Getenv("SecurityRolesApi_SecurityRolesGetIdentitiesWithRole_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("SecurityRolesApi_SecurityRolesGetIdentitiesWithRole_id: %v", id) - resp, httpRes, err := apiClient.SecurityRolesApi.SecurityRolesGetIdentitiesWithRole(context.Background(), id).Execute() + resp, httpRes, err := apiClient.SecurityRolesApi.SecurityRolesGetIdentitiesWithRole(context.Background(), id.(int32)).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -59,9 +70,13 @@ func Test_command_SecurityRolesApiService(t *testing.T) { t.Run("Test SecurityRolesApiService SecurityRolesUpdateIdentitiesWithRole", func(t *testing.T) { - var id int32 + var id interface{} + + id = os.Getenv("SecurityRolesApi_SecurityRolesUpdateIdentitiesWithRole_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("SecurityRolesApi_SecurityRolesUpdateIdentitiesWithRole_id: %v", id) - resp, httpRes, err := apiClient.SecurityRolesApi.SecurityRolesUpdateIdentitiesWithRole(context.Background(), id).Execute() + resp, httpRes, err := apiClient.SecurityRolesApi.SecurityRolesUpdateIdentitiesWithRole(context.Background(), id.(int32)).Execute() require.Nil(t, err) require.NotNil(t, resp) diff --git a/api/command/api_security_test.go b/api/command/api_security_test.go index b1d817b..a80aa8f 100644 --- a/api/command/api_security_test.go +++ b/api/command/api_security_test.go @@ -23,10 +23,13 @@ import ( "context" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "os" "testing" ) func Test_command_SecurityApiService(t *testing.T) { + cwd, _ := os.Getwd() + t.Logf("Working directory: %s", cwd) config := GetEnvConfiguration() configuration, configErr := NewConfiguration(config) @@ -36,9 +39,13 @@ func Test_command_SecurityApiService(t *testing.T) { t.Run("Test SecurityApiService SecurityDeleteSecurityIdentity", func(t *testing.T) { - var id int32 + var id interface{} - httpRes, err := apiClient.SecurityApi.SecurityDeleteSecurityIdentity(context.Background(), id).Execute() + id = os.Getenv("SecurityApi_SecurityDeleteSecurityIdentity_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("SecurityApi_SecurityDeleteSecurityIdentity_id: %v", id) + + httpRes, err := apiClient.SecurityApi.SecurityDeleteSecurityIdentity(context.Background(), id.(int32)).Execute() require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) @@ -47,9 +54,13 @@ func Test_command_SecurityApiService(t *testing.T) { t.Run("Test SecurityApiService SecurityIdentityPermissions", func(t *testing.T) { - var id int32 + var id interface{} + + id = os.Getenv("SecurityApi_SecurityIdentityPermissions_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("SecurityApi_SecurityIdentityPermissions_id: %v", id) - resp, httpRes, err := apiClient.SecurityApi.SecurityIdentityPermissions(context.Background(), id).Execute() + resp, httpRes, err := apiClient.SecurityApi.SecurityIdentityPermissions(context.Background(), id.(int32)).Execute() require.Nil(t, err) require.NotNil(t, resp) diff --git a/api/command/api_server.go b/api/command/api_server.go index bdde4de..fcf5616 100644 --- a/api/command/api_server.go +++ b/api/command/api_server.go @@ -91,9 +91,12 @@ func (a *ServerApiService) ServerAddAccessExecute(r ApiServerAddAccessRequest) ( localVarReturnValue *ModelsSSHAccessServerAccessResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSH/Servers/Access" + localVarPath := apiBasePath + "/SSH/Servers/Access" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -223,9 +226,12 @@ func (a *ServerApiService) ServerCreateServerExecute(r ApiServerCreateServerRequ localVarReturnValue *ModelsSSHServersServerResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSH/Servers" + localVarPath := apiBasePath + "/SSH/Servers" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -348,9 +354,12 @@ func (a *ServerApiService) ServerDeleteExecute(r ApiServerDeleteRequest) (*http. formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSH/Servers/{id}" + localVarPath := apiBasePath + "/SSH/Servers/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -463,9 +472,12 @@ func (a *ServerApiService) ServerGetExecute(r ApiServerGetRequest) (*ModelsSSHSe localVarReturnValue *ModelsSSHServersServerResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSH/Servers/{id}" + localVarPath := apiBasePath + "/SSH/Servers/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -587,9 +599,12 @@ func (a *ServerApiService) ServerGetAccessExecute(r ApiServerGetAccessRequest) ( localVarReturnValue *ModelsSSHAccessServerAccessResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSH/Servers/Access/{id}" + localVarPath := apiBasePath + "/SSH/Servers/Access/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -743,9 +758,12 @@ func (a *ServerApiService) ServerQueryServersExecute(r ApiServerQueryServersRequ localVarReturnValue []ModelsSSHServersServerResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSH/Servers" + localVarPath := apiBasePath + "/SSH/Servers" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -885,9 +903,12 @@ func (a *ServerApiService) ServerRemoveAccessExecute(r ApiServerRemoveAccessRequ localVarReturnValue *ModelsSSHAccessServerAccessResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSH/Servers/Access" + localVarPath := apiBasePath + "/SSH/Servers/Access" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1017,9 +1038,12 @@ func (a *ServerApiService) ServerUpdateServerExecute(r ApiServerUpdateServerRequ localVarReturnValue *ModelsSSHServersServerResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSH/Servers" + localVarPath := apiBasePath + "/SSH/Servers" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} diff --git a/api/command/api_server_group.go b/api/command/api_server_group.go index dd2cc20..44c9d8f 100644 --- a/api/command/api_server_group.go +++ b/api/command/api_server_group.go @@ -90,9 +90,12 @@ func (a *ServerGroupApiService) ServerGroupAddAccessExecute(r ApiServerGroupAddA localVarReturnValue *ModelsSSHAccessServerGroupAccessResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSH/ServerGroups/Access" + localVarPath := apiBasePath + "/SSH/ServerGroups/Access" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -222,9 +225,12 @@ func (a *ServerGroupApiService) ServerGroupCreateServerGroupExecute(r ApiServerG localVarReturnValue *ModelsSSHServerGroupsServerGroupResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSH/ServerGroups" + localVarPath := apiBasePath + "/SSH/ServerGroups" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -347,9 +353,12 @@ func (a *ServerGroupApiService) ServerGroupDeleteExecute(r ApiServerGroupDeleteR formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSH/ServerGroups/{id}" + localVarPath := apiBasePath + "/SSH/ServerGroups/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -462,9 +471,12 @@ func (a *ServerGroupApiService) ServerGroupGetAccessExecute(r ApiServerGroupGetA localVarReturnValue *ModelsSSHAccessServerGroupAccessResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSH/ServerGroups/Access/{id}" + localVarPath := apiBasePath + "/SSH/ServerGroups/Access/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -586,9 +598,12 @@ func (a *ServerGroupApiService) ServerGroupGetGroupExecute(r ApiServerGroupGetGr localVarReturnValue *ModelsSSHServerGroupsServerGroupResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSH/ServerGroups/{id}" + localVarPath := apiBasePath + "/SSH/ServerGroups/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -710,9 +725,12 @@ func (a *ServerGroupApiService) ServerGroupGetGroupByNameExecute(r ApiServerGrou localVarReturnValue *ModelsSSHServerGroupsServerGroupResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSH/ServerGroups/{name}" + localVarPath := apiBasePath + "/SSH/ServerGroups/{name}" localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", url.PathEscape(parameterValueToString(r.name, "name")), -1) localVarHeaderParams := make(map[string]string) @@ -866,9 +884,12 @@ func (a *ServerGroupApiService) ServerGroupQueryServerGroupsExecute(r ApiServerG localVarReturnValue []ModelsSSHServerGroupsServerGroupResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSH/ServerGroups" + localVarPath := apiBasePath + "/SSH/ServerGroups" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1007,9 +1028,12 @@ func (a *ServerGroupApiService) ServerGroupRemoveAccessExecute(r ApiServerGroupR localVarReturnValue *ModelsSSHAccessServerGroupAccessResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSH/ServerGroups/Access" + localVarPath := apiBasePath + "/SSH/ServerGroups/Access" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1139,9 +1163,12 @@ func (a *ServerGroupApiService) ServerGroupUpdateServerGroupExecute(r ApiServerG localVarReturnValue *ModelsSSHServerGroupsServerGroupResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSH/ServerGroups" + localVarPath := apiBasePath + "/SSH/ServerGroups" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} diff --git a/api/command/api_server_group_test.go b/api/command/api_server_group_test.go index e069496..328b4c1 100644 --- a/api/command/api_server_group_test.go +++ b/api/command/api_server_group_test.go @@ -23,10 +23,13 @@ import ( "context" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "os" "testing" ) func Test_command_ServerGroupApiService(t *testing.T) { + cwd, _ := os.Getwd() + t.Logf("Working directory: %s", cwd) config := GetEnvConfiguration() configuration, configErr := NewConfiguration(config) @@ -56,9 +59,13 @@ func Test_command_ServerGroupApiService(t *testing.T) { t.Run("Test ServerGroupApiService ServerGroupDelete", func(t *testing.T) { - var id string + var id interface{} - httpRes, err := apiClient.ServerGroupApi.ServerGroupDelete(context.Background(), id).Execute() + id = os.Getenv("ServerGroupApi_ServerGroupDelete_id") + id, _ = convertParamInterface(id, "string") + t.Logf("ServerGroupApi_ServerGroupDelete_id: %v", id) + + httpRes, err := apiClient.ServerGroupApi.ServerGroupDelete(context.Background(), id.(string)).Execute() require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) @@ -67,9 +74,13 @@ func Test_command_ServerGroupApiService(t *testing.T) { t.Run("Test ServerGroupApiService ServerGroupGetAccess", func(t *testing.T) { - var id string + var id interface{} + + id = os.Getenv("ServerGroupApi_ServerGroupGetAccess_id") + id, _ = convertParamInterface(id, "string") + t.Logf("ServerGroupApi_ServerGroupGetAccess_id: %v", id) - resp, httpRes, err := apiClient.ServerGroupApi.ServerGroupGetAccess(context.Background(), id).Execute() + resp, httpRes, err := apiClient.ServerGroupApi.ServerGroupGetAccess(context.Background(), id.(string)).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -79,9 +90,13 @@ func Test_command_ServerGroupApiService(t *testing.T) { t.Run("Test ServerGroupApiService ServerGroupGetGroup", func(t *testing.T) { - var id string + var id interface{} - resp, httpRes, err := apiClient.ServerGroupApi.ServerGroupGetGroup(context.Background(), id).Execute() + id = os.Getenv("ServerGroupApi_ServerGroupGetGroup_id") + id, _ = convertParamInterface(id, "string") + t.Logf("ServerGroupApi_ServerGroupGetGroup_id: %v", id) + + resp, httpRes, err := apiClient.ServerGroupApi.ServerGroupGetGroup(context.Background(), id.(string)).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -91,9 +106,13 @@ func Test_command_ServerGroupApiService(t *testing.T) { t.Run("Test ServerGroupApiService ServerGroupGetGroupByName", func(t *testing.T) { - var name string + var name interface{} + + name = os.Getenv("ServerGroupApi_ServerGroupGetGroupByName_name") + name, _ = convertParamInterface(name, "string") + t.Logf("ServerGroupApi_ServerGroupGetGroupByName_name: %v", name) - resp, httpRes, err := apiClient.ServerGroupApi.ServerGroupGetGroupByName(context.Background(), name).Execute() + resp, httpRes, err := apiClient.ServerGroupApi.ServerGroupGetGroupByName(context.Background(), name.(string)).Execute() require.Nil(t, err) require.NotNil(t, resp) diff --git a/api/command/api_server_test.go b/api/command/api_server_test.go index 7befbbf..f045ddc 100644 --- a/api/command/api_server_test.go +++ b/api/command/api_server_test.go @@ -23,10 +23,13 @@ import ( "context" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "os" "testing" ) func Test_command_ServerApiService(t *testing.T) { + cwd, _ := os.Getwd() + t.Logf("Working directory: %s", cwd) config := GetEnvConfiguration() configuration, configErr := NewConfiguration(config) @@ -56,9 +59,13 @@ func Test_command_ServerApiService(t *testing.T) { t.Run("Test ServerApiService ServerDelete", func(t *testing.T) { - var id int32 + var id interface{} - httpRes, err := apiClient.ServerApi.ServerDelete(context.Background(), id).Execute() + id = os.Getenv("ServerApi_ServerDelete_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("ServerApi_ServerDelete_id: %v", id) + + httpRes, err := apiClient.ServerApi.ServerDelete(context.Background(), id.(int32)).Execute() require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) @@ -67,9 +74,13 @@ func Test_command_ServerApiService(t *testing.T) { t.Run("Test ServerApiService ServerGet", func(t *testing.T) { - var id int32 + var id interface{} + + id = os.Getenv("ServerApi_ServerGet_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("ServerApi_ServerGet_id: %v", id) - resp, httpRes, err := apiClient.ServerApi.ServerGet(context.Background(), id).Execute() + resp, httpRes, err := apiClient.ServerApi.ServerGet(context.Background(), id.(int32)).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -79,9 +90,13 @@ func Test_command_ServerApiService(t *testing.T) { t.Run("Test ServerApiService ServerGetAccess", func(t *testing.T) { - var id int32 + var id interface{} + + id = os.Getenv("ServerApi_ServerGetAccess_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("ServerApi_ServerGetAccess_id: %v", id) - resp, httpRes, err := apiClient.ServerApi.ServerGetAccess(context.Background(), id).Execute() + resp, httpRes, err := apiClient.ServerApi.ServerGetAccess(context.Background(), id.(int32)).Execute() require.Nil(t, err) require.NotNil(t, resp) diff --git a/api/command/api_service_account.go b/api/command/api_service_account.go index 36093a4..f8c7d7a 100644 --- a/api/command/api_service_account.go +++ b/api/command/api_service_account.go @@ -91,9 +91,12 @@ func (a *ServiceAccountApiService) ServiceAccountCreateServiceAccountExecute(r A localVarReturnValue *ModelsSSHServiceAccountsServiceAccountResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSH/ServiceAccounts" + localVarPath := apiBasePath + "/SSH/ServiceAccounts" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -216,9 +219,12 @@ func (a *ServiceAccountApiService) ServiceAccountDeleteServiceAccountExecute(r A formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSH/ServiceAccounts/{id}" + localVarPath := apiBasePath + "/SSH/ServiceAccounts/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -332,9 +338,12 @@ func (a *ServiceAccountApiService) ServiceAccountDeleteServiceAccountsExecute(r formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSH/ServiceAccounts" + localVarPath := apiBasePath + "/SSH/ServiceAccounts" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -451,9 +460,12 @@ func (a *ServiceAccountApiService) ServiceAccountGetExecute(r ApiServiceAccountG localVarReturnValue *ModelsSSHServiceAccountsServiceAccountResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSH/ServiceAccounts/{id}" + localVarPath := apiBasePath + "/SSH/ServiceAccounts/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -582,9 +594,12 @@ func (a *ServiceAccountApiService) ServiceAccountGetServiceAccountKeyExecute(r A localVarReturnValue *ModelsSSHKeysKeyResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSH/ServiceAccounts/Key/{id}" + localVarPath := apiBasePath + "/SSH/ServiceAccounts/Key/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -741,9 +756,12 @@ func (a *ServiceAccountApiService) ServiceAccountQueryServiceAccountsExecute(r A localVarReturnValue []ModelsSSHServiceAccountsServiceAccountResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSH/ServiceAccounts" + localVarPath := apiBasePath + "/SSH/ServiceAccounts" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -885,9 +903,12 @@ func (a *ServiceAccountApiService) ServiceAccountRotateServiceAccountKeyExecute( localVarReturnValue *ModelsSSHKeysKeyResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSH/ServiceAccounts/Rotate/{id}" + localVarPath := apiBasePath + "/SSH/ServiceAccounts/Rotate/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -1018,9 +1039,12 @@ func (a *ServiceAccountApiService) ServiceAccountUpdateServiceAccountExecute(r A localVarReturnValue *ModelsSSHServiceAccountsServiceAccountResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSH/ServiceAccounts" + localVarPath := apiBasePath + "/SSH/ServiceAccounts" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} diff --git a/api/command/api_service_account_test.go b/api/command/api_service_account_test.go index 6c8394e..add3fb2 100644 --- a/api/command/api_service_account_test.go +++ b/api/command/api_service_account_test.go @@ -23,10 +23,13 @@ import ( "context" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "os" "testing" ) func Test_command_ServiceAccountApiService(t *testing.T) { + cwd, _ := os.Getwd() + t.Logf("Working directory: %s", cwd) config := GetEnvConfiguration() configuration, configErr := NewConfiguration(config) @@ -46,9 +49,13 @@ func Test_command_ServiceAccountApiService(t *testing.T) { t.Run("Test ServiceAccountApiService ServiceAccountDeleteServiceAccount", func(t *testing.T) { - var id int32 + var id interface{} - httpRes, err := apiClient.ServiceAccountApi.ServiceAccountDeleteServiceAccount(context.Background(), id).Execute() + id = os.Getenv("ServiceAccountApi_ServiceAccountDeleteServiceAccount_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("ServiceAccountApi_ServiceAccountDeleteServiceAccount_id: %v", id) + + httpRes, err := apiClient.ServiceAccountApi.ServiceAccountDeleteServiceAccount(context.Background(), id.(int32)).Execute() require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) @@ -66,9 +73,13 @@ func Test_command_ServiceAccountApiService(t *testing.T) { t.Run("Test ServiceAccountApiService ServiceAccountGet", func(t *testing.T) { - var id int32 + var id interface{} + + id = os.Getenv("ServiceAccountApi_ServiceAccountGet_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("ServiceAccountApi_ServiceAccountGet_id: %v", id) - resp, httpRes, err := apiClient.ServiceAccountApi.ServiceAccountGet(context.Background(), id).Execute() + resp, httpRes, err := apiClient.ServiceAccountApi.ServiceAccountGet(context.Background(), id.(int32)).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -78,9 +89,13 @@ func Test_command_ServiceAccountApiService(t *testing.T) { t.Run("Test ServiceAccountApiService ServiceAccountGetServiceAccountKey", func(t *testing.T) { - var id int32 + var id interface{} - resp, httpRes, err := apiClient.ServiceAccountApi.ServiceAccountGetServiceAccountKey(context.Background(), id).Execute() + id = os.Getenv("ServiceAccountApi_ServiceAccountGetServiceAccountKey_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("ServiceAccountApi_ServiceAccountGetServiceAccountKey_id: %v", id) + + resp, httpRes, err := apiClient.ServiceAccountApi.ServiceAccountGetServiceAccountKey(context.Background(), id.(int32)).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -100,9 +115,13 @@ func Test_command_ServiceAccountApiService(t *testing.T) { t.Run("Test ServiceAccountApiService ServiceAccountRotateServiceAccountKey", func(t *testing.T) { - var id int32 + var id interface{} + + id = os.Getenv("ServiceAccountApi_ServiceAccountRotateServiceAccountKey_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("ServiceAccountApi_ServiceAccountRotateServiceAccountKey_id: %v", id) - resp, httpRes, err := apiClient.ServiceAccountApi.ServiceAccountRotateServiceAccountKey(context.Background(), id).Execute() + resp, httpRes, err := apiClient.ServiceAccountApi.ServiceAccountRotateServiceAccountKey(context.Background(), id.(int32)).Execute() require.Nil(t, err) require.NotNil(t, resp) diff --git a/api/command/api_smtp.go b/api/command/api_smtp.go index 10d8bfa..f39dcaf 100644 --- a/api/command/api_smtp.go +++ b/api/command/api_smtp.go @@ -83,9 +83,12 @@ func (a *SMTPApiService) SMTPSMTPExecute(r ApiSMTPSMTPRequest) (*KeyfactorAPIMod localVarReturnValue *KeyfactorAPIModelsSMTPSMTPResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SMTP" + localVarPath := apiBasePath + "/SMTP" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -209,9 +212,12 @@ func (a *SMTPApiService) SMTPTestSMTPExecute(r ApiSMTPTestSMTPRequest) (*Keyfact localVarReturnValue *KeyfactorAPIModelsSMTPSMTPTestResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SMTP/Test" + localVarPath := apiBasePath + "/SMTP/Test" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -340,9 +346,12 @@ func (a *SMTPApiService) SMTPUpdateSMTPExecute(r ApiSMTPUpdateSMTPRequest) (*Key localVarReturnValue *KeyfactorAPIModelsSMTPSMTPResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SMTP" + localVarPath := apiBasePath + "/SMTP" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} diff --git a/api/command/api_smtp_test.go b/api/command/api_smtp_test.go index 4585b74..17b4286 100644 --- a/api/command/api_smtp_test.go +++ b/api/command/api_smtp_test.go @@ -23,10 +23,13 @@ import ( "context" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "os" "testing" ) func Test_command_SMTPApiService(t *testing.T) { + cwd, _ := os.Getwd() + t.Logf("Working directory: %s", cwd) config := GetEnvConfiguration() configuration, configErr := NewConfiguration(config) diff --git a/api/command/api_ssl.go b/api/command/api_ssl.go index 41ad8f8..ea438c6 100644 --- a/api/command/api_ssl.go +++ b/api/command/api_ssl.go @@ -88,9 +88,12 @@ func (a *SslApiService) SslAddNetworkRangesExecute(r ApiSslAddNetworkRangesReque formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSL/NetworkRanges" + localVarPath := apiBasePath + "/SSL/NetworkRanges" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -211,9 +214,12 @@ func (a *SslApiService) SslCreateNetworkExecute(r ApiSslCreateNetworkRequest) (* localVarReturnValue *KeyfactorApiModelsSslNetworkResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSL/Networks" + localVarPath := apiBasePath + "/SSL/Networks" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -339,9 +345,12 @@ func (a *SslApiService) SslEndpointExecute(r ApiSslEndpointRequest) (*ModelsSSLE localVarReturnValue *ModelsSSLEndpoint ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSL/Endpoints/{id}" + localVarPath := apiBasePath + "/SSL/Endpoints/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -498,9 +507,12 @@ func (a *SslApiService) SslEndpointHistoryExecute(r ApiSslEndpointHistoryRequest localVarReturnValue []ModelsSSLEndpointHistoryResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSL/Endpoints/{id}/History" + localVarPath := apiBasePath + "/SSL/Endpoints/{id}/History" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -637,9 +649,12 @@ func (a *SslApiService) SslGetNetworkExecute(r ApiSslGetNetworkRequest) (*Keyfac localVarReturnValue *KeyfactorApiModelsSslNetworkResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSL/Networks/{identifier}" + localVarPath := apiBasePath + "/SSL/Networks/{identifier}" localVarPath = strings.Replace(localVarPath, "{"+"identifier"+"}", url.PathEscape(parameterValueToString(r.identifier, "identifier")), -1) localVarHeaderParams := make(map[string]string) @@ -761,9 +776,12 @@ func (a *SslApiService) SslGetNetworkRangesForNetworkExecute(r ApiSslGetNetworkR localVarReturnValue []ModelsSSLNetworkDefinition ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSL/NetworkRanges/{id}" + localVarPath := apiBasePath + "/SSL/NetworkRanges/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -917,9 +935,12 @@ func (a *SslApiService) SslGetNetworksExecute(r ApiSslGetNetworksRequest) ([]Key localVarReturnValue []KeyfactorApiModelsSslNetworkQueryResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSL/Networks" + localVarPath := apiBasePath + "/SSL/Networks" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1059,9 +1080,12 @@ func (a *SslApiService) SslImmediateSslScanExecute(r ApiSslImmediateSslScanReque formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSL/Networks/{id}/Scan" + localVarPath := apiBasePath + "/SSL/Networks/{id}/Scan" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -1180,9 +1204,12 @@ func (a *SslApiService) SslMonitorAllExecute(r ApiSslMonitorAllRequest) (*http.R formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSL/Endpoints/MonitorAll" + localVarPath := apiBasePath + "/SSL/Endpoints/MonitorAll" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1298,9 +1325,12 @@ func (a *SslApiService) SslMonitoringStatusExecute(r ApiSslMonitoringStatusReque formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSL/Endpoints/MonitorStatus" + localVarPath := apiBasePath + "/SSL/Endpoints/MonitorStatus" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1458,9 +1488,12 @@ func (a *SslApiService) SslNetworkScanPartsExecute(r ApiSslNetworkScanPartsReque localVarReturnValue []ModelsSSLDisplayScanJobPart ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSL/Networks/{id}/Parts" + localVarPath := apiBasePath + "/SSL/Networks/{id}/Parts" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -1597,9 +1630,12 @@ func (a *SslApiService) SslRemoveAllNetworkRangesExecute(r ApiSslRemoveAllNetwor formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSL/NetworkRanges/{id}" + localVarPath := apiBasePath + "/SSL/NetworkRanges/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -1709,9 +1745,12 @@ func (a *SslApiService) SslRemoveNetworkExecute(r ApiSslRemoveNetworkRequest) (* formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSL/Networks/{id}" + localVarPath := apiBasePath + "/SSL/Networks/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -1856,9 +1895,12 @@ func (a *SslApiService) SslResultsExecute(r ApiSslResultsRequest) ([]ModelsSSLSs localVarReturnValue []ModelsSSLSslScanResult ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSL" + localVarPath := apiBasePath + "/SSL" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1995,9 +2037,12 @@ func (a *SslApiService) SslReviewAllExecute(r ApiSslReviewAllRequest) (*http.Res formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSL/Endpoints/ReviewAll" + localVarPath := apiBasePath + "/SSL/Endpoints/ReviewAll" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2113,9 +2158,12 @@ func (a *SslApiService) SslReviewedStatusExecute(r ApiSslReviewedStatusRequest) formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSL/Endpoints/ReviewStatus" + localVarPath := apiBasePath + "/SSL/Endpoints/ReviewStatus" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2232,9 +2280,12 @@ func (a *SslApiService) SslScanPartExecute(r ApiSslScanPartRequest) (*ModelsSSLS localVarReturnValue *ModelsSSLScanJobPart ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSL/Parts/{id}" + localVarPath := apiBasePath + "/SSL/Parts/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -2357,9 +2408,12 @@ func (a *SslApiService) SslSetNetworkRangesExecute(r ApiSslSetNetworkRangesReque formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSL/NetworkRanges" + localVarPath := apiBasePath + "/SSL/NetworkRanges" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2480,9 +2534,12 @@ func (a *SslApiService) SslUpdateNetworkExecute(r ApiSslUpdateNetworkRequest) (* localVarReturnValue *KeyfactorApiModelsSslNetworkResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSL/Networks" + localVarPath := apiBasePath + "/SSL/Networks" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2609,9 +2666,12 @@ func (a *SslApiService) SslValidateNetworkRangesExecute(r ApiSslValidateNetworkR formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSL/NetworkRanges/Validate" + localVarPath := apiBasePath + "/SSL/NetworkRanges/Validate" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} diff --git a/api/command/api_ssl_test.go b/api/command/api_ssl_test.go index 2a66436..94015e3 100644 --- a/api/command/api_ssl_test.go +++ b/api/command/api_ssl_test.go @@ -23,10 +23,13 @@ import ( "context" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "os" "testing" ) func Test_command_SslApiService(t *testing.T) { + cwd, _ := os.Getwd() + t.Logf("Working directory: %s", cwd) config := GetEnvConfiguration() configuration, configErr := NewConfiguration(config) @@ -55,9 +58,13 @@ func Test_command_SslApiService(t *testing.T) { t.Run("Test SslApiService SslEndpoint", func(t *testing.T) { - var id string + var id interface{} - resp, httpRes, err := apiClient.SslApi.SslEndpoint(context.Background(), id).Execute() + id = os.Getenv("SslApi_SslEndpoint_id") + id, _ = convertParamInterface(id, "string") + t.Logf("SslApi_SslEndpoint_id: %v", id) + + resp, httpRes, err := apiClient.SslApi.SslEndpoint(context.Background(), id.(string)).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -67,9 +74,13 @@ func Test_command_SslApiService(t *testing.T) { t.Run("Test SslApiService SslEndpointHistory", func(t *testing.T) { - var id string + var id interface{} + + id = os.Getenv("SslApi_SslEndpointHistory_id") + id, _ = convertParamInterface(id, "string") + t.Logf("SslApi_SslEndpointHistory_id: %v", id) - resp, httpRes, err := apiClient.SslApi.SslEndpointHistory(context.Background(), id).Execute() + resp, httpRes, err := apiClient.SslApi.SslEndpointHistory(context.Background(), id.(string)).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -79,9 +90,13 @@ func Test_command_SslApiService(t *testing.T) { t.Run("Test SslApiService SslGetNetwork", func(t *testing.T) { - var identifier string + var identifier interface{} + + identifier = os.Getenv("SslApi_SslGetNetwork_identifier") + identifier, _ = convertParamInterface(identifier, "string") + t.Logf("SslApi_SslGetNetwork_identifier: %v", identifier) - resp, httpRes, err := apiClient.SslApi.SslGetNetwork(context.Background(), identifier).Execute() + resp, httpRes, err := apiClient.SslApi.SslGetNetwork(context.Background(), identifier.(string)).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -91,9 +106,13 @@ func Test_command_SslApiService(t *testing.T) { t.Run("Test SslApiService SslGetNetworkRangesForNetwork", func(t *testing.T) { - var id string + var id interface{} - resp, httpRes, err := apiClient.SslApi.SslGetNetworkRangesForNetwork(context.Background(), id).Execute() + id = os.Getenv("SslApi_SslGetNetworkRangesForNetwork_id") + id, _ = convertParamInterface(id, "string") + t.Logf("SslApi_SslGetNetworkRangesForNetwork_id: %v", id) + + resp, httpRes, err := apiClient.SslApi.SslGetNetworkRangesForNetwork(context.Background(), id.(string)).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -113,9 +132,13 @@ func Test_command_SslApiService(t *testing.T) { t.Run("Test SslApiService SslImmediateSslScan", func(t *testing.T) { - var id string + var id interface{} + + id = os.Getenv("SslApi_SslImmediateSslScan_id") + id, _ = convertParamInterface(id, "string") + t.Logf("SslApi_SslImmediateSslScan_id: %v", id) - httpRes, err := apiClient.SslApi.SslImmediateSslScan(context.Background(), id).Execute() + httpRes, err := apiClient.SslApi.SslImmediateSslScan(context.Background(), id.(string)).Execute() require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) @@ -142,9 +165,13 @@ func Test_command_SslApiService(t *testing.T) { t.Run("Test SslApiService SslNetworkScanParts", func(t *testing.T) { - var id string + var id interface{} - resp, httpRes, err := apiClient.SslApi.SslNetworkScanParts(context.Background(), id).Execute() + id = os.Getenv("SslApi_SslNetworkScanParts_id") + id, _ = convertParamInterface(id, "string") + t.Logf("SslApi_SslNetworkScanParts_id: %v", id) + + resp, httpRes, err := apiClient.SslApi.SslNetworkScanParts(context.Background(), id.(string)).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -154,9 +181,13 @@ func Test_command_SslApiService(t *testing.T) { t.Run("Test SslApiService SslRemoveAllNetworkRanges", func(t *testing.T) { - var id string + var id interface{} + + id = os.Getenv("SslApi_SslRemoveAllNetworkRanges_id") + id, _ = convertParamInterface(id, "string") + t.Logf("SslApi_SslRemoveAllNetworkRanges_id: %v", id) - httpRes, err := apiClient.SslApi.SslRemoveAllNetworkRanges(context.Background(), id).Execute() + httpRes, err := apiClient.SslApi.SslRemoveAllNetworkRanges(context.Background(), id.(string)).Execute() require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) @@ -165,9 +196,13 @@ func Test_command_SslApiService(t *testing.T) { t.Run("Test SslApiService SslRemoveNetwork", func(t *testing.T) { - var id string + var id interface{} - httpRes, err := apiClient.SslApi.SslRemoveNetwork(context.Background(), id).Execute() + id = os.Getenv("SslApi_SslRemoveNetwork_id") + id, _ = convertParamInterface(id, "string") + t.Logf("SslApi_SslRemoveNetwork_id: %v", id) + + httpRes, err := apiClient.SslApi.SslRemoveNetwork(context.Background(), id.(string)).Execute() require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) @@ -204,9 +239,13 @@ func Test_command_SslApiService(t *testing.T) { t.Run("Test SslApiService SslScanPart", func(t *testing.T) { - var id string + var id interface{} + + id = os.Getenv("SslApi_SslScanPart_id") + id, _ = convertParamInterface(id, "string") + t.Logf("SslApi_SslScanPart_id: %v", id) - resp, httpRes, err := apiClient.SslApi.SslScanPart(context.Background(), id).Execute() + resp, httpRes, err := apiClient.SslApi.SslScanPart(context.Background(), id.(string)).Execute() require.Nil(t, err) require.NotNil(t, resp) diff --git a/api/command/api_status.go b/api/command/api_status.go index 57f47bb..a55b76d 100644 --- a/api/command/api_status.go +++ b/api/command/api_status.go @@ -83,9 +83,12 @@ func (a *StatusApiService) StatusGetEndpointsExecute(r ApiStatusGetEndpointsRequ localVarReturnValue []string ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Status/Endpoints" + localVarPath := apiBasePath + "/Status/Endpoints" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} diff --git a/api/command/api_status_test.go b/api/command/api_status_test.go index 4a2d0ee..be823a2 100644 --- a/api/command/api_status_test.go +++ b/api/command/api_status_test.go @@ -23,10 +23,13 @@ import ( "context" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "os" "testing" ) func Test_command_StatusApiService(t *testing.T) { + cwd, _ := os.Getwd() + t.Logf("Working directory: %s", cwd) config := GetEnvConfiguration() configuration, configErr := NewConfiguration(config) diff --git a/api/command/api_template.go b/api/command/api_template.go index 70e73ec..99f23cd 100644 --- a/api/command/api_template.go +++ b/api/command/api_template.go @@ -84,9 +84,12 @@ func (a *TemplateApiService) TemplateGetGlobalSettingsExecute(r ApiTemplateGetGl localVarReturnValue *KeyfactorApiModelsTemplatesGlobalTemplateSettingsResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Templates/Settings" + localVarPath := apiBasePath + "/Templates/Settings" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -207,9 +210,12 @@ func (a *TemplateApiService) TemplateGetTemplateExecute(r ApiTemplateGetTemplate localVarReturnValue *ModelsTemplateRetrievalResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Templates/{id}" + localVarPath := apiBasePath + "/Templates/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -363,9 +369,12 @@ func (a *TemplateApiService) TemplateGetTemplatesExecute(r ApiTemplateGetTemplat localVarReturnValue []ModelsTemplateCollectionRetrievalResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Templates" + localVarPath := apiBasePath + "/Templates" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -498,9 +507,12 @@ func (a *TemplateApiService) TemplateGetValidSubjectPartsExecute(r ApiTemplateGe localVarReturnValue []KeyfactorApiModelsTemplatesValidSubjectPartResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Templates/SubjectParts" + localVarPath := apiBasePath + "/Templates/SubjectParts" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -622,9 +634,12 @@ func (a *TemplateApiService) TemplateImportExecute(r ApiTemplateImportRequest) ( formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Templates/Import" + localVarPath := apiBasePath + "/Templates/Import" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -745,9 +760,12 @@ func (a *TemplateApiService) TemplateUpdateGlobalSettingsExecute(r ApiTemplateUp localVarReturnValue *KeyfactorApiModelsTemplatesGlobalTemplateSettingsResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Templates/Settings" + localVarPath := apiBasePath + "/Templates/Settings" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -877,9 +895,12 @@ func (a *TemplateApiService) TemplateUpdateTemplateExecute(r ApiTemplateUpdateTe localVarReturnValue *ModelsTemplateRetrievalResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Templates" + localVarPath := apiBasePath + "/Templates" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} diff --git a/api/command/api_template_test.go b/api/command/api_template_test.go index 9cbf339..7045099 100644 --- a/api/command/api_template_test.go +++ b/api/command/api_template_test.go @@ -23,10 +23,13 @@ import ( "context" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "os" "testing" ) func Test_command_TemplateApiService(t *testing.T) { + cwd, _ := os.Getwd() + t.Logf("Working directory: %s", cwd) config := GetEnvConfiguration() configuration, configErr := NewConfiguration(config) @@ -46,9 +49,13 @@ func Test_command_TemplateApiService(t *testing.T) { t.Run("Test TemplateApiService TemplateGetTemplate", func(t *testing.T) { - var id int32 + var id interface{} - resp, httpRes, err := apiClient.TemplateApi.TemplateGetTemplate(context.Background(), id).Execute() + id = os.Getenv("TemplateApi_TemplateGetTemplate_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("TemplateApi_TemplateGetTemplate_id: %v", id) + + resp, httpRes, err := apiClient.TemplateApi.TemplateGetTemplate(context.Background(), id.(int32)).Execute() require.Nil(t, err) require.NotNil(t, resp) diff --git a/api/command/api_user.go b/api/command/api_user.go index 05cdc07..6042954 100644 --- a/api/command/api_user.go +++ b/api/command/api_user.go @@ -91,9 +91,12 @@ func (a *UserApiService) UserCreateUserExecute(r ApiUserCreateUserRequest) (*Mod localVarReturnValue *ModelsSSHUsersSshUserResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSH/Users" + localVarPath := apiBasePath + "/SSH/Users" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -216,9 +219,12 @@ func (a *UserApiService) UserDeleteUserExecute(r ApiUserDeleteUserRequest) (*htt formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSH/Users/{id}" + localVarPath := apiBasePath + "/SSH/Users/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -331,9 +337,12 @@ func (a *UserApiService) UserGetUserExecute(r ApiUserGetUserRequest) (*ModelsSSH localVarReturnValue *ModelsSSHUsersSshUserResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSH/Users/{id}" + localVarPath := apiBasePath + "/SSH/Users/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -494,9 +503,12 @@ func (a *UserApiService) UserQueryUsersExecute(r ApiUserQueryUsersRequest) ([]Mo localVarReturnValue []ModelsSSHUsersSshUserResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSH/Users" + localVarPath := apiBasePath + "/SSH/Users" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -639,9 +651,12 @@ func (a *UserApiService) UserUpdateUserExecute(r ApiUserUpdateUserRequest) (*Mod localVarReturnValue *ModelsSSHUsersSshUserResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSH/Users" + localVarPath := apiBasePath + "/SSH/Users" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -771,9 +786,12 @@ func (a *UserApiService) UserUserAccessExecute(r ApiUserUserAccessRequest) (*Mod localVarReturnValue *ModelsSSHUsersSshUserAccessResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/SSH/Users/Access" + localVarPath := apiBasePath + "/SSH/Users/Access" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} diff --git a/api/command/api_user_test.go b/api/command/api_user_test.go index d2edb52..0bcf267 100644 --- a/api/command/api_user_test.go +++ b/api/command/api_user_test.go @@ -23,10 +23,13 @@ import ( "context" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "os" "testing" ) func Test_command_UserApiService(t *testing.T) { + cwd, _ := os.Getwd() + t.Logf("Working directory: %s", cwd) config := GetEnvConfiguration() configuration, configErr := NewConfiguration(config) @@ -46,9 +49,13 @@ func Test_command_UserApiService(t *testing.T) { t.Run("Test UserApiService UserDeleteUser", func(t *testing.T) { - var id int32 + var id interface{} - httpRes, err := apiClient.UserApi.UserDeleteUser(context.Background(), id).Execute() + id = os.Getenv("UserApi_UserDeleteUser_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("UserApi_UserDeleteUser_id: %v", id) + + httpRes, err := apiClient.UserApi.UserDeleteUser(context.Background(), id.(int32)).Execute() require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) @@ -57,9 +64,13 @@ func Test_command_UserApiService(t *testing.T) { t.Run("Test UserApiService UserGetUser", func(t *testing.T) { - var id int32 + var id interface{} + + id = os.Getenv("UserApi_UserGetUser_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("UserApi_UserGetUser_id: %v", id) - resp, httpRes, err := apiClient.UserApi.UserGetUser(context.Background(), id).Execute() + resp, httpRes, err := apiClient.UserApi.UserGetUser(context.Background(), id.(int32)).Execute() require.Nil(t, err) require.NotNil(t, resp) diff --git a/api/command/api_workflow.go b/api/command/api_workflow.go index eacb0e9..2435df1 100644 --- a/api/command/api_workflow.go +++ b/api/command/api_workflow.go @@ -91,9 +91,12 @@ func (a *WorkflowApiService) WorkflowApprovePendingRequestsExecute(r ApiWorkflow localVarReturnValue *ModelsWorkflowApproveDenyResult ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Workflow/Certificates/Approve" + localVarPath := apiBasePath + "/Workflow/Certificates/Approve" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -223,9 +226,12 @@ func (a *WorkflowApiService) WorkflowDenyPendingRequestsExecute(r ApiWorkflowDen localVarReturnValue *ModelsWorkflowApproveDenyResult ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Workflow/Certificates/Deny" + localVarPath := apiBasePath + "/Workflow/Certificates/Deny" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -383,9 +389,12 @@ func (a *WorkflowApiService) WorkflowGetExecute(r ApiWorkflowGetRequest) ([]Mode localVarReturnValue []ModelsWorkflowCertificateRequestModel ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Workflow/Certificates/Pending" + localVarPath := apiBasePath + "/Workflow/Certificates/Pending" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -521,9 +530,12 @@ func (a *WorkflowApiService) WorkflowGetCertificateRequestDetailsExecute(r ApiWo localVarReturnValue *ModelsWorkflowCertificateRequestDetailsModel ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Workflow/Certificates/{id}" + localVarPath := apiBasePath + "/Workflow/Certificates/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -677,9 +689,12 @@ func (a *WorkflowApiService) WorkflowGetDeniedExecute(r ApiWorkflowGetDeniedRequ localVarReturnValue []ModelsWorkflowCertificateRequestModel ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Workflow/Certificates/Denied" + localVarPath := apiBasePath + "/Workflow/Certificates/Denied" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} diff --git a/api/command/api_workflow_definition.go b/api/command/api_workflow_definition.go index d64a4c3..97f0bdb 100644 --- a/api/command/api_workflow_definition.go +++ b/api/command/api_workflow_definition.go @@ -96,9 +96,12 @@ func (a *WorkflowDefinitionApiService) WorkflowDefinitionConfigureDefinitionStep localVarReturnValue *KeyfactorApiModelsWorkflowsDefinitionResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Workflow/Definitions/{definitionId}/Steps" + localVarPath := apiBasePath + "/Workflow/Definitions/{definitionId}/Steps" localVarPath = strings.Replace(localVarPath, "{"+"definitionId"+"}", url.PathEscape(parameterValueToString(r.definitionId, "definitionId")), -1) localVarHeaderParams := make(map[string]string) @@ -229,9 +232,12 @@ func (a *WorkflowDefinitionApiService) WorkflowDefinitionCreateNewDefinitionExec localVarReturnValue *KeyfactorApiModelsWorkflowsDefinitionResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Workflow/Definitions" + localVarPath := apiBasePath + "/Workflow/Definitions" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -354,9 +360,12 @@ func (a *WorkflowDefinitionApiService) WorkflowDefinitionDeleteExecute(r ApiWork formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Workflow/Definitions/{definitionId}" + localVarPath := apiBasePath + "/Workflow/Definitions/{definitionId}" localVarPath = strings.Replace(localVarPath, "{"+"definitionId"+"}", url.PathEscape(parameterValueToString(r.definitionId, "definitionId")), -1) localVarHeaderParams := make(map[string]string) @@ -483,9 +492,12 @@ func (a *WorkflowDefinitionApiService) WorkflowDefinitionGetExecute(r ApiWorkflo localVarReturnValue *KeyfactorApiModelsWorkflowsDefinitionResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Workflow/Definitions/{definitionId}" + localVarPath := apiBasePath + "/Workflow/Definitions/{definitionId}" localVarPath = strings.Replace(localVarPath, "{"+"definitionId"+"}", url.PathEscape(parameterValueToString(r.definitionId, "definitionId")), -1) localVarHeaderParams := make(map[string]string) @@ -613,9 +625,12 @@ func (a *WorkflowDefinitionApiService) WorkflowDefinitionGetStepSchemaExecute(r localVarReturnValue *KeyfactorApiModelsWorkflowsAvailableStepResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Workflow/Definitions/Steps/{extensionName}" + localVarPath := apiBasePath + "/Workflow/Definitions/Steps/{extensionName}" localVarPath = strings.Replace(localVarPath, "{"+"extensionName"+"}", url.PathEscape(parameterValueToString(r.extensionName, "extensionName")), -1) localVarHeaderParams := make(map[string]string) @@ -737,9 +752,12 @@ func (a *WorkflowDefinitionApiService) WorkflowDefinitionPublishDefinitionExecut localVarReturnValue *KeyfactorApiModelsWorkflowsDefinitionResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Workflow/Definitions/{definitionId}/Publish" + localVarPath := apiBasePath + "/Workflow/Definitions/{definitionId}/Publish" localVarPath = strings.Replace(localVarPath, "{"+"definitionId"+"}", url.PathEscape(parameterValueToString(r.definitionId, "definitionId")), -1) localVarHeaderParams := make(map[string]string) @@ -893,9 +911,12 @@ func (a *WorkflowDefinitionApiService) WorkflowDefinitionQueryExecute(r ApiWorkf localVarReturnValue []KeyfactorApiModelsWorkflowsDefinitionQueryResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Workflow/Definitions" + localVarPath := apiBasePath + "/Workflow/Definitions" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1063,9 +1084,12 @@ func (a *WorkflowDefinitionApiService) WorkflowDefinitionQueryAvailableStepsExec localVarReturnValue []KeyfactorApiModelsWorkflowsAvailableStepQueryResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Workflow/Definitions/Steps" + localVarPath := apiBasePath + "/Workflow/Definitions/Steps" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1233,9 +1257,12 @@ func (a *WorkflowDefinitionApiService) WorkflowDefinitionQueryWorkflowTypesExecu localVarReturnValue []KeyfactorApiModelsWorkflowsWorkflowTypeQueryResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Workflow/Definitions/Types" + localVarPath := apiBasePath + "/Workflow/Definitions/Types" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1378,9 +1405,12 @@ func (a *WorkflowDefinitionApiService) WorkflowDefinitionUpdateExistingDefinitio localVarReturnValue *KeyfactorApiModelsWorkflowsDefinitionResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Workflow/Definitions/{definitionId}" + localVarPath := apiBasePath + "/Workflow/Definitions/{definitionId}" localVarPath = strings.Replace(localVarPath, "{"+"definitionId"+"}", url.PathEscape(parameterValueToString(r.definitionId, "definitionId")), -1) localVarHeaderParams := make(map[string]string) diff --git a/api/command/api_workflow_definition_test.go b/api/command/api_workflow_definition_test.go index 0f24aec..0330d9e 100644 --- a/api/command/api_workflow_definition_test.go +++ b/api/command/api_workflow_definition_test.go @@ -23,10 +23,13 @@ import ( "context" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "os" "testing" ) func Test_command_WorkflowDefinitionApiService(t *testing.T) { + cwd, _ := os.Getwd() + t.Logf("Working directory: %s", cwd) config := GetEnvConfiguration() configuration, configErr := NewConfiguration(config) @@ -36,9 +39,13 @@ func Test_command_WorkflowDefinitionApiService(t *testing.T) { t.Run("Test WorkflowDefinitionApiService WorkflowDefinitionConfigureDefinitionSteps", func(t *testing.T) { - var definitionId string + var definitionId interface{} - resp, httpRes, err := apiClient.WorkflowDefinitionApi.WorkflowDefinitionConfigureDefinitionSteps(context.Background(), definitionId).Execute() + definitionId = os.Getenv("WorkflowDefinitionApi_WorkflowDefinitionConfigureDefinitionSteps_definitionId") + definitionId, _ = convertParamInterface(definitionId, "string") + t.Logf("WorkflowDefinitionApi_WorkflowDefinitionConfigureDefinitionSteps_definitionId: %v", definitionId) + + resp, httpRes, err := apiClient.WorkflowDefinitionApi.WorkflowDefinitionConfigureDefinitionSteps(context.Background(), definitionId.(string)).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -58,9 +65,13 @@ func Test_command_WorkflowDefinitionApiService(t *testing.T) { t.Run("Test WorkflowDefinitionApiService WorkflowDefinitionDelete", func(t *testing.T) { - var definitionId string + var definitionId interface{} + + definitionId = os.Getenv("WorkflowDefinitionApi_WorkflowDefinitionDelete_definitionId") + definitionId, _ = convertParamInterface(definitionId, "string") + t.Logf("WorkflowDefinitionApi_WorkflowDefinitionDelete_definitionId: %v", definitionId) - httpRes, err := apiClient.WorkflowDefinitionApi.WorkflowDefinitionDelete(context.Background(), definitionId).Execute() + httpRes, err := apiClient.WorkflowDefinitionApi.WorkflowDefinitionDelete(context.Background(), definitionId.(string)).Execute() require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) @@ -69,9 +80,13 @@ func Test_command_WorkflowDefinitionApiService(t *testing.T) { t.Run("Test WorkflowDefinitionApiService WorkflowDefinitionGet", func(t *testing.T) { - var definitionId string + var definitionId interface{} + + definitionId = os.Getenv("WorkflowDefinitionApi_WorkflowDefinitionGet_definitionId") + definitionId, _ = convertParamInterface(definitionId, "string") + t.Logf("WorkflowDefinitionApi_WorkflowDefinitionGet_definitionId: %v", definitionId) - resp, httpRes, err := apiClient.WorkflowDefinitionApi.WorkflowDefinitionGet(context.Background(), definitionId).Execute() + resp, httpRes, err := apiClient.WorkflowDefinitionApi.WorkflowDefinitionGet(context.Background(), definitionId.(string)).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -81,9 +96,13 @@ func Test_command_WorkflowDefinitionApiService(t *testing.T) { t.Run("Test WorkflowDefinitionApiService WorkflowDefinitionGetStepSchema", func(t *testing.T) { - var extensionName string + var extensionName interface{} - resp, httpRes, err := apiClient.WorkflowDefinitionApi.WorkflowDefinitionGetStepSchema(context.Background(), extensionName).Execute() + extensionName = os.Getenv("WorkflowDefinitionApi_WorkflowDefinitionGetStepSchema_extensionName") + extensionName, _ = convertParamInterface(extensionName, "string") + t.Logf("WorkflowDefinitionApi_WorkflowDefinitionGetStepSchema_extensionName: %v", extensionName) + + resp, httpRes, err := apiClient.WorkflowDefinitionApi.WorkflowDefinitionGetStepSchema(context.Background(), extensionName.(string)).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -93,9 +112,13 @@ func Test_command_WorkflowDefinitionApiService(t *testing.T) { t.Run("Test WorkflowDefinitionApiService WorkflowDefinitionPublishDefinition", func(t *testing.T) { - var definitionId string + var definitionId interface{} + + definitionId = os.Getenv("WorkflowDefinitionApi_WorkflowDefinitionPublishDefinition_definitionId") + definitionId, _ = convertParamInterface(definitionId, "string") + t.Logf("WorkflowDefinitionApi_WorkflowDefinitionPublishDefinition_definitionId: %v", definitionId) - resp, httpRes, err := apiClient.WorkflowDefinitionApi.WorkflowDefinitionPublishDefinition(context.Background(), definitionId).Execute() + resp, httpRes, err := apiClient.WorkflowDefinitionApi.WorkflowDefinitionPublishDefinition(context.Background(), definitionId.(string)).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -135,9 +158,13 @@ func Test_command_WorkflowDefinitionApiService(t *testing.T) { t.Run("Test WorkflowDefinitionApiService WorkflowDefinitionUpdateExistingDefinition", func(t *testing.T) { - var definitionId string + var definitionId interface{} + + definitionId = os.Getenv("WorkflowDefinitionApi_WorkflowDefinitionUpdateExistingDefinition_definitionId") + definitionId, _ = convertParamInterface(definitionId, "string") + t.Logf("WorkflowDefinitionApi_WorkflowDefinitionUpdateExistingDefinition_definitionId: %v", definitionId) - resp, httpRes, err := apiClient.WorkflowDefinitionApi.WorkflowDefinitionUpdateExistingDefinition(context.Background(), definitionId).Execute() + resp, httpRes, err := apiClient.WorkflowDefinitionApi.WorkflowDefinitionUpdateExistingDefinition(context.Background(), definitionId.(string)).Execute() require.Nil(t, err) require.NotNil(t, resp) diff --git a/api/command/api_workflow_instance.go b/api/command/api_workflow_instance.go index b2b1f5b..29643ab 100644 --- a/api/command/api_workflow_instance.go +++ b/api/command/api_workflow_instance.go @@ -84,9 +84,12 @@ func (a *WorkflowInstanceApiService) WorkflowInstanceDeleteInstanceExecute(r Api formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Workflow/Instances/{instanceId}" + localVarPath := apiBasePath + "/Workflow/Instances/{instanceId}" localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) @@ -199,9 +202,12 @@ func (a *WorkflowInstanceApiService) WorkflowInstanceGetExecute(r ApiWorkflowIns localVarReturnValue *KeyfactorApiModelsWorkflowsInstanceResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Workflow/Instances/{instanceId}" + localVarPath := apiBasePath + "/Workflow/Instances/{instanceId}" localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) @@ -355,9 +361,12 @@ func (a *WorkflowInstanceApiService) WorkflowInstanceQueryExecute(r ApiWorkflowI localVarReturnValue []KeyfactorApiModelsWorkflowsInstanceQueryResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Workflow/Instances" + localVarPath := apiBasePath + "/Workflow/Instances" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -525,9 +534,12 @@ func (a *WorkflowInstanceApiService) WorkflowInstanceQueryInstancesAssignedToMeE localVarReturnValue []KeyfactorApiModelsWorkflowsInstanceQueryResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Workflow/Instances/AssignedToMe" + localVarPath := apiBasePath + "/Workflow/Instances/AssignedToMe" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -695,9 +707,12 @@ func (a *WorkflowInstanceApiService) WorkflowInstanceQueryInstancesStartedByMeEx localVarReturnValue []KeyfactorApiModelsWorkflowsInstanceQueryResponse ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Workflow/Instances/My" + localVarPath := apiBasePath + "/Workflow/Instances/My" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -837,9 +852,12 @@ func (a *WorkflowInstanceApiService) WorkflowInstanceRestartExecute(r ApiWorkflo formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Workflow/Instances/{instanceId}/Restart" + localVarPath := apiBasePath + "/Workflow/Instances/{instanceId}/Restart" localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) @@ -959,9 +977,12 @@ func (a *WorkflowInstanceApiService) WorkflowInstanceSignalExecute(r ApiWorkflow formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Workflow/Instances/{instanceId}/Signals" + localVarPath := apiBasePath + "/Workflow/Instances/{instanceId}/Signals" localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) @@ -1076,9 +1097,12 @@ func (a *WorkflowInstanceApiService) WorkflowInstanceStopExecute(r ApiWorkflowIn formFiles []formFile ) - localBasePath := "/KeyfactorAPI" + apiBasePath := a.client.cfg.APIPath + if apiBasePath == "" { + apiBasePath = "/KeyfactorAPI" + } - localVarPath := localBasePath + "/Workflow/Instances/{instanceId}/Stop" + localVarPath := apiBasePath + "/Workflow/Instances/{instanceId}/Stop" localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) diff --git a/api/command/api_workflow_instance_test.go b/api/command/api_workflow_instance_test.go index 380df59..fa4cc97 100644 --- a/api/command/api_workflow_instance_test.go +++ b/api/command/api_workflow_instance_test.go @@ -23,10 +23,13 @@ import ( "context" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "os" "testing" ) func Test_command_WorkflowInstanceApiService(t *testing.T) { + cwd, _ := os.Getwd() + t.Logf("Working directory: %s", cwd) config := GetEnvConfiguration() configuration, configErr := NewConfiguration(config) @@ -36,9 +39,13 @@ func Test_command_WorkflowInstanceApiService(t *testing.T) { t.Run("Test WorkflowInstanceApiService WorkflowInstanceDeleteInstance", func(t *testing.T) { - var instanceId string + var instanceId interface{} - httpRes, err := apiClient.WorkflowInstanceApi.WorkflowInstanceDeleteInstance(context.Background(), instanceId).Execute() + instanceId = os.Getenv("WorkflowInstanceApi_WorkflowInstanceDeleteInstance_instanceId") + instanceId, _ = convertParamInterface(instanceId, "string") + t.Logf("WorkflowInstanceApi_WorkflowInstanceDeleteInstance_instanceId: %v", instanceId) + + httpRes, err := apiClient.WorkflowInstanceApi.WorkflowInstanceDeleteInstance(context.Background(), instanceId.(string)).Execute() require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) @@ -47,9 +54,13 @@ func Test_command_WorkflowInstanceApiService(t *testing.T) { t.Run("Test WorkflowInstanceApiService WorkflowInstanceGet", func(t *testing.T) { - var instanceId string + var instanceId interface{} + + instanceId = os.Getenv("WorkflowInstanceApi_WorkflowInstanceGet_instanceId") + instanceId, _ = convertParamInterface(instanceId, "string") + t.Logf("WorkflowInstanceApi_WorkflowInstanceGet_instanceId: %v", instanceId) - resp, httpRes, err := apiClient.WorkflowInstanceApi.WorkflowInstanceGet(context.Background(), instanceId).Execute() + resp, httpRes, err := apiClient.WorkflowInstanceApi.WorkflowInstanceGet(context.Background(), instanceId.(string)).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -89,9 +100,13 @@ func Test_command_WorkflowInstanceApiService(t *testing.T) { t.Run("Test WorkflowInstanceApiService WorkflowInstanceRestart", func(t *testing.T) { - var instanceId string + var instanceId interface{} + + instanceId = os.Getenv("WorkflowInstanceApi_WorkflowInstanceRestart_instanceId") + instanceId, _ = convertParamInterface(instanceId, "string") + t.Logf("WorkflowInstanceApi_WorkflowInstanceRestart_instanceId: %v", instanceId) - httpRes, err := apiClient.WorkflowInstanceApi.WorkflowInstanceRestart(context.Background(), instanceId).Execute() + httpRes, err := apiClient.WorkflowInstanceApi.WorkflowInstanceRestart(context.Background(), instanceId.(string)).Execute() require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) @@ -100,9 +115,13 @@ func Test_command_WorkflowInstanceApiService(t *testing.T) { t.Run("Test WorkflowInstanceApiService WorkflowInstanceSignal", func(t *testing.T) { - var instanceId string + var instanceId interface{} - httpRes, err := apiClient.WorkflowInstanceApi.WorkflowInstanceSignal(context.Background(), instanceId).Execute() + instanceId = os.Getenv("WorkflowInstanceApi_WorkflowInstanceSignal_instanceId") + instanceId, _ = convertParamInterface(instanceId, "string") + t.Logf("WorkflowInstanceApi_WorkflowInstanceSignal_instanceId: %v", instanceId) + + httpRes, err := apiClient.WorkflowInstanceApi.WorkflowInstanceSignal(context.Background(), instanceId.(string)).Execute() require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) @@ -111,9 +130,13 @@ func Test_command_WorkflowInstanceApiService(t *testing.T) { t.Run("Test WorkflowInstanceApiService WorkflowInstanceStop", func(t *testing.T) { - var instanceId string + var instanceId interface{} + + instanceId = os.Getenv("WorkflowInstanceApi_WorkflowInstanceStop_instanceId") + instanceId, _ = convertParamInterface(instanceId, "string") + t.Logf("WorkflowInstanceApi_WorkflowInstanceStop_instanceId: %v", instanceId) - httpRes, err := apiClient.WorkflowInstanceApi.WorkflowInstanceStop(context.Background(), instanceId).Execute() + httpRes, err := apiClient.WorkflowInstanceApi.WorkflowInstanceStop(context.Background(), instanceId.(string)).Execute() require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) diff --git a/api/command/api_workflow_test.go b/api/command/api_workflow_test.go index 0ccfd84..2777c95 100644 --- a/api/command/api_workflow_test.go +++ b/api/command/api_workflow_test.go @@ -23,10 +23,13 @@ import ( "context" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "os" "testing" ) func Test_command_WorkflowApiService(t *testing.T) { + cwd, _ := os.Getwd() + t.Logf("Working directory: %s", cwd) config := GetEnvConfiguration() configuration, configErr := NewConfiguration(config) @@ -66,9 +69,13 @@ func Test_command_WorkflowApiService(t *testing.T) { t.Run("Test WorkflowApiService WorkflowGetCertificateRequestDetails", func(t *testing.T) { - var id int32 + var id interface{} - resp, httpRes, err := apiClient.WorkflowApi.WorkflowGetCertificateRequestDetails(context.Background(), id).Execute() + id = os.Getenv("WorkflowApi_WorkflowGetCertificateRequestDetails_id") + id, _ = convertParamInterface(id, "int32") + t.Logf("WorkflowApi_WorkflowGetCertificateRequestDetails_id: %v", id) + + resp, httpRes, err := apiClient.WorkflowApi.WorkflowGetCertificateRequestDetails(context.Background(), id.(int32)).Execute() require.Nil(t, err) require.NotNil(t, resp) diff --git a/api/command/client.go b/api/command/client.go index 812a888..4176fe2 100644 --- a/api/command/client.go +++ b/api/command/client.go @@ -903,3 +903,32 @@ func formatErrorMessage(status string, v interface{}) string { // status title (detail) return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) } + +func convertParamInterface(param interface{}, format string) (interface{}, error) { + if param == nil { + return nil, nil + } + + switch format { + case "int32": + val, err := strconv.ParseInt(fmt.Sprintf("%v", param), 10, 32) + return int32(val), err + case "int64": + return strconv.ParseInt(fmt.Sprintf("%v", param), 10, 64) + case "float32": + val, err := strconv.ParseFloat(fmt.Sprintf("%v", param), 32) + return float32(val), err + case "float64": + return strconv.ParseFloat(fmt.Sprintf("%v", param), 64) + case "byte": + return []byte(fmt.Sprintf("%v", param)), nil + case "date": + return time.Parse("2006-01-02", fmt.Sprintf("%v", param)) + case "date-time": + return time.Parse(time.RFC3339, fmt.Sprintf("%v", param)) + case "password": + return fmt.Sprintf("%v", param), nil + default: + return param, nil + } +} diff --git a/docs/AgentApi.md b/docs/AgentApi.md index 7d39598..2084b96 100644 --- a/docs/AgentApi.md +++ b/docs/AgentApi.md @@ -9,9 +9,9 @@ Method | HTTP request | Description [**AgentFetchLogs**](AgentApi.md#AgentFetchLogs) | **Post** /Agents/{id}/FetchLogs | Schedules a job on the agent to retrieve log files [**AgentGetAgentDetail**](AgentApi.md#AgentGetAgentDetail) | **Get** /Agents/{id} | Returns details for a single agent, specified by ID [**AgentGetAgents**](AgentApi.md#AgentGetAgents) | **Get** /Agents | Returns all agents according to the provided filter and output parameters -[**AgentReset0**](AgentApi.md#AgentReset0) | **Post** /Agents/Reset | Reset a list of agents -[**AgentReset1**](AgentApi.md#AgentReset1) | **Post** /Agents/{id}/Reset | Reset an agent to a new state +[**AgentReset**](AgentApi.md#AgentReset) | **Post** /Agents/{id}/Reset | Reset an agent to a new state [**AgentSetAuthCertificateReenrollment**](AgentApi.md#AgentSetAuthCertificateReenrollment) | **Post** /Agents/SetAuthCertificateReenrollment | Update the AuthCertificateReenrollment value for an agent to request or require (or unset the request) the agent to enroll for a new client authentication certificate on its next registration. +[**AgentsReset**](AgentApi.md#AgentsReset) | **Post** /Agents/Reset | Reset a list of agents @@ -365,11 +365,11 @@ Name | Type | Description | Notes [[Back to README]](../README.md) -## AgentReset0 +## AgentReset -> AgentReset0(ctx).XKeyfactorRequestedWith(xKeyfactorRequestedWith).AgentIds(agentIds).XKeyfactorApiVersion(xKeyfactorApiVersion).Execute() +> AgentReset(ctx, id).XKeyfactorRequestedWith(xKeyfactorRequestedWith).XKeyfactorApiVersion(xKeyfactorApiVersion).Execute() -Reset a list of agents +Reset an agent to a new state ### Example @@ -384,15 +384,15 @@ import ( ) func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Guid Id of Agent to reset xKeyfactorRequestedWith := "xKeyfactorRequestedWith_example" // string | Type of the request [XMLHttpRequest, APIClient] (default to "APIClient") - agentIds := []string{"Property_example"} // []string | List of Agent Ids to Reset xKeyfactorApiVersion := "xKeyfactorApiVersion_example" // string | Desired version of the api, if not provided defaults to v1 (optional) (default to "1") configuration := openapiclient.NewConfiguration(make(map[string]string)) apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.AgentApi.AgentReset0(context.Background()).XKeyfactorRequestedWith(xKeyfactorRequestedWith).AgentIds(agentIds).XKeyfactorApiVersion(xKeyfactorApiVersion).Execute() + resp, r, err := apiClient.AgentApi.AgentReset(context.Background(), id).XKeyfactorRequestedWith(xKeyfactorRequestedWith).XKeyfactorApiVersion(xKeyfactorApiVersion).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `AgentApi.AgentReset0``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `AgentApi.AgentReset``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } } @@ -401,16 +401,20 @@ func main() { ### Path Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Guid Id of Agent to reset | ### Other Parameters -Other parameters are passed through a pointer to a apiAgentReset0Request struct via the builder pattern +Other parameters are passed through a pointer to a apiAgentResetRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- + **xKeyfactorRequestedWith** | **string** | Type of the request [XMLHttpRequest, APIClient] | [default to "APIClient"] - **agentIds** | **[]string** | List of Agent Ids to Reset | **xKeyfactorApiVersion** | **string** | Desired version of the api, if not provided defaults to v1 | [default to "1"] ### Return type @@ -423,7 +427,7 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: application/json +- **Content-Type**: Not defined - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) @@ -431,11 +435,11 @@ Name | Type | Description | Notes [[Back to README]](../README.md) -## AgentReset1 +## AgentSetAuthCertificateReenrollment -> AgentReset1(ctx, id).XKeyfactorRequestedWith(xKeyfactorRequestedWith).XKeyfactorApiVersion(xKeyfactorApiVersion).Execute() +> KeyfactorApiModelsOrchestratorsUpdateOrchestratorAuthCertificateReenrollmentResponse AgentSetAuthCertificateReenrollment(ctx).XKeyfactorRequestedWith(xKeyfactorRequestedWith).AuthCertReenrollmentRequest(authCertReenrollmentRequest).XKeyfactorApiVersion(xKeyfactorApiVersion).Execute() -Reset an agent to a new state +Update the AuthCertificateReenrollment value for an agent to request or require (or unset the request) the agent to enroll for a new client authentication certificate on its next registration. ### Example @@ -450,42 +454,40 @@ import ( ) func main() { - id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Guid Id of Agent to reset xKeyfactorRequestedWith := "xKeyfactorRequestedWith_example" // string | Type of the request [XMLHttpRequest, APIClient] (default to "APIClient") + authCertReenrollmentRequest := *openapiclient.NewKeyfactorApiModelsOrchestratorsUpdateOrchestratorAuthCertificateReenrollmentRequest("Status_example") // KeyfactorApiModelsOrchestratorsUpdateOrchestratorAuthCertificateReenrollmentRequest | Object containing orchestrator ids and the new status those orchestrators should have xKeyfactorApiVersion := "xKeyfactorApiVersion_example" // string | Desired version of the api, if not provided defaults to v1 (optional) (default to "1") configuration := openapiclient.NewConfiguration(make(map[string]string)) apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.AgentApi.AgentReset1(context.Background(), id).XKeyfactorRequestedWith(xKeyfactorRequestedWith).XKeyfactorApiVersion(xKeyfactorApiVersion).Execute() + resp, r, err := apiClient.AgentApi.AgentSetAuthCertificateReenrollment(context.Background()).XKeyfactorRequestedWith(xKeyfactorRequestedWith).AuthCertReenrollmentRequest(authCertReenrollmentRequest).XKeyfactorApiVersion(xKeyfactorApiVersion).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `AgentApi.AgentReset1``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `AgentApi.AgentSetAuthCertificateReenrollment``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } + // response from `AgentSetAuthCertificateReenrollment`: KeyfactorApiModelsOrchestratorsUpdateOrchestratorAuthCertificateReenrollmentResponse + fmt.Fprintf(os.Stdout, "Response from `AgentApi.AgentSetAuthCertificateReenrollment`: %v\n", resp) } ``` ### Path Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**id** | **string** | Guid Id of Agent to reset | ### Other Parameters -Other parameters are passed through a pointer to a apiAgentReset1Request struct via the builder pattern +Other parameters are passed through a pointer to a apiAgentSetAuthCertificateReenrollmentRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **xKeyfactorRequestedWith** | **string** | Type of the request [XMLHttpRequest, APIClient] | [default to "APIClient"] + **authCertReenrollmentRequest** | [**KeyfactorApiModelsOrchestratorsUpdateOrchestratorAuthCertificateReenrollmentRequest**](KeyfactorApiModelsOrchestratorsUpdateOrchestratorAuthCertificateReenrollmentRequest.md) | Object containing orchestrator ids and the new status those orchestrators should have | **xKeyfactorApiVersion** | **string** | Desired version of the api, if not provided defaults to v1 | [default to "1"] ### Return type - (empty response body) +[**KeyfactorApiModelsOrchestratorsUpdateOrchestratorAuthCertificateReenrollmentResponse**](KeyfactorApiModelsOrchestratorsUpdateOrchestratorAuthCertificateReenrollmentResponse.md) ### Authorization @@ -493,19 +495,19 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: Not defined +- **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) -## AgentSetAuthCertificateReenrollment +## AgentsReset -> KeyfactorApiModelsOrchestratorsUpdateOrchestratorAuthCertificateReenrollmentResponse AgentSetAuthCertificateReenrollment(ctx).XKeyfactorRequestedWith(xKeyfactorRequestedWith).AuthCertReenrollmentRequest(authCertReenrollmentRequest).XKeyfactorApiVersion(xKeyfactorApiVersion).Execute() +> AgentsReset(ctx).XKeyfactorRequestedWith(xKeyfactorRequestedWith).AgentIds(agentIds).XKeyfactorApiVersion(xKeyfactorApiVersion).Execute() -Update the AuthCertificateReenrollment value for an agent to request or require (or unset the request) the agent to enroll for a new client authentication certificate on its next registration. +Reset a list of agents ### Example @@ -521,18 +523,16 @@ import ( func main() { xKeyfactorRequestedWith := "xKeyfactorRequestedWith_example" // string | Type of the request [XMLHttpRequest, APIClient] (default to "APIClient") - authCertReenrollmentRequest := *openapiclient.NewKeyfactorApiModelsOrchestratorsUpdateOrchestratorAuthCertificateReenrollmentRequest("Status_example") // KeyfactorApiModelsOrchestratorsUpdateOrchestratorAuthCertificateReenrollmentRequest | Object containing orchestrator ids and the new status those orchestrators should have + agentIds := []string{"Property_example"} // []string | List of Agent Ids to Reset xKeyfactorApiVersion := "xKeyfactorApiVersion_example" // string | Desired version of the api, if not provided defaults to v1 (optional) (default to "1") configuration := openapiclient.NewConfiguration(make(map[string]string)) apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.AgentApi.AgentSetAuthCertificateReenrollment(context.Background()).XKeyfactorRequestedWith(xKeyfactorRequestedWith).AuthCertReenrollmentRequest(authCertReenrollmentRequest).XKeyfactorApiVersion(xKeyfactorApiVersion).Execute() + resp, r, err := apiClient.AgentApi.AgentsReset(context.Background()).XKeyfactorRequestedWith(xKeyfactorRequestedWith).AgentIds(agentIds).XKeyfactorApiVersion(xKeyfactorApiVersion).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `AgentApi.AgentSetAuthCertificateReenrollment``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `AgentApi.AgentsReset``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `AgentSetAuthCertificateReenrollment`: KeyfactorApiModelsOrchestratorsUpdateOrchestratorAuthCertificateReenrollmentResponse - fmt.Fprintf(os.Stdout, "Response from `AgentApi.AgentSetAuthCertificateReenrollment`: %v\n", resp) } ``` @@ -542,18 +542,18 @@ func main() { ### Other Parameters -Other parameters are passed through a pointer to a apiAgentSetAuthCertificateReenrollmentRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiAgentsResetRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **xKeyfactorRequestedWith** | **string** | Type of the request [XMLHttpRequest, APIClient] | [default to "APIClient"] - **authCertReenrollmentRequest** | [**KeyfactorApiModelsOrchestratorsUpdateOrchestratorAuthCertificateReenrollmentRequest**](KeyfactorApiModelsOrchestratorsUpdateOrchestratorAuthCertificateReenrollmentRequest.md) | Object containing orchestrator ids and the new status those orchestrators should have | + **agentIds** | **[]string** | List of Agent Ids to Reset | **xKeyfactorApiVersion** | **string** | Desired version of the api, if not provided defaults to v1 | [default to "1"] ### Return type -[**KeyfactorApiModelsOrchestratorsUpdateOrchestratorAuthCertificateReenrollmentResponse**](KeyfactorApiModelsOrchestratorsUpdateOrchestratorAuthCertificateReenrollmentResponse.md) + (empty response body) ### Authorization @@ -562,7 +562,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: application/json -- **Accept**: application/json +- **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models)