/*
Edge Application API

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

API version: 2.0.0
*/

// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.

package edgeapplications

import (
	"bytes"
	"context"
	"io"
	"net/http"
	"net/url"
	"strings"
)


// EdgeApplicationsCacheSettingsAPIService EdgeApplicationsCacheSettingsAPI service
type EdgeApplicationsCacheSettingsAPIService service

type ApiEdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdDeleteRequest struct {
	ctx context.Context
	ApiService *EdgeApplicationsCacheSettingsAPIService
	edgeApplicationId int64
	cacheSettingsId int64
	accept *string
	contentType *string
}

func (r ApiEdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdDeleteRequest) Accept(accept string) ApiEdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdDeleteRequest {
	r.accept = &accept
	return r
}

// The type of coding used in the Body (application/json). &lt;br&gt;  Example: Content-Type: application/json
func (r ApiEdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdDeleteRequest) ContentType(contentType string) ApiEdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdDeleteRequest {
	r.contentType = &contentType
	return r
}

func (r ApiEdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdDeleteRequest) Execute() (*http.Response, error) {
	return r.ApiService.EdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdDeleteExecute(r)
}

/*
EdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdDelete /edge_applications/:edge_application_id:/cache_settings/:cache_settings_id:

 @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
 @param edgeApplicationId
 @param cacheSettingsId
 @return ApiEdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdDeleteRequest
*/
func (a *EdgeApplicationsCacheSettingsAPIService) EdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdDelete(ctx context.Context, edgeApplicationId int64, cacheSettingsId int64) ApiEdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdDeleteRequest {
	return ApiEdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdDeleteRequest{
		ApiService: a,
		ctx: ctx,
		edgeApplicationId: edgeApplicationId,
		cacheSettingsId: cacheSettingsId,
	}
}

// Execute executes the request
func (a *EdgeApplicationsCacheSettingsAPIService) EdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdDeleteExecute(r ApiEdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdDeleteRequest) (*http.Response, error) {
	var (
		localVarHTTPMethod   = http.MethodDelete
		localVarPostBody     interface{}
		formFiles            []formFile
	)

	localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EdgeApplicationsCacheSettingsAPIService.EdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdDelete")
	if err != nil {
		return nil, &GenericOpenAPIError{error: err.Error()}
	}

	localVarPath := localBasePath + "/edge_applications/{edge_application_id}/cache_settings/{cache_settings_id}"
	localVarPath = strings.Replace(localVarPath, "{"+"edge_application_id"+"}", url.PathEscape(parameterValueToString(r.edgeApplicationId, "edgeApplicationId")), -1)
	localVarPath = strings.Replace(localVarPath, "{"+"cache_settings_id"+"}", url.PathEscape(parameterValueToString(r.cacheSettingsId, "cacheSettingsId")), -1)

	localVarHeaderParams := make(map[string]string)
	localVarQueryParams := url.Values{}
	localVarFormParams := url.Values{}

	// to determine the Content-Type header
	localVarHTTPContentTypes := []string{}

	// set Content-Type header
	localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
	if localVarHTTPContentType != "" {
		localVarHeaderParams["Content-Type"] = localVarHTTPContentType
	}

	// to determine the Accept header
	localVarHTTPHeaderAccepts := []string{}

	// set Accept header
	localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
	if localVarHTTPHeaderAccept != "" {
		localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
	}
	if r.accept != nil {
		parameterAddToHeaderOrQuery(localVarHeaderParams, "Accept", r.accept, "simple", "")
	}
	if r.contentType != nil {
		parameterAddToHeaderOrQuery(localVarHeaderParams, "Content-Type", r.contentType, "simple", "")
	}
	if r.ctx != nil {
		// API Key Authentication
		if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok {
			if apiKey, ok := auth["tokenAuth"]; ok {
				var key string
				if apiKey.Prefix != "" {
					key = apiKey.Prefix + " " + apiKey.Key
				} else {
					key = apiKey.Key
				}
				localVarHeaderParams["Authorization"] = key
			}
		}
	}
	req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
	if err != nil {
		return nil, err
	}

	localVarHTTPResponse, err := a.client.callAPI(req)
	if err != nil || localVarHTTPResponse == nil {
		return localVarHTTPResponse, err
	}

	localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
	localVarHTTPResponse.Body.Close()
	localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
	if err != nil {
		return localVarHTTPResponse, err
	}

	if localVarHTTPResponse.StatusCode >= 300 {
		newErr := &GenericOpenAPIError{
			body:  localVarBody,
			error: localVarHTTPResponse.Status,
		}
		return localVarHTTPResponse, newErr
	}

	return localVarHTTPResponse, nil
}

type ApiEdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdGetRequest struct {
	ctx context.Context
	ApiService *EdgeApplicationsCacheSettingsAPIService
	edgeApplicationId int64
	cacheSettingsId int64
	accept *string
}

func (r ApiEdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdGetRequest) Accept(accept string) ApiEdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdGetRequest {
	r.accept = &accept
	return r
}

func (r ApiEdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdGetRequest) Execute() (*ApplicationCacheGetOneResponse, *http.Response, error) {
	return r.ApiService.EdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdGetExecute(r)
}

/*
EdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdGet /edge_applications/:edge_application_id:/cache_settings/:cache_settings_id:

 @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
 @param edgeApplicationId
 @param cacheSettingsId
 @return ApiEdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdGetRequest
*/
func (a *EdgeApplicationsCacheSettingsAPIService) EdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdGet(ctx context.Context, edgeApplicationId int64, cacheSettingsId int64) ApiEdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdGetRequest {
	return ApiEdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdGetRequest{
		ApiService: a,
		ctx: ctx,
		edgeApplicationId: edgeApplicationId,
		cacheSettingsId: cacheSettingsId,
	}
}

// Execute executes the request
//  @return ApplicationCacheGetOneResponse
func (a *EdgeApplicationsCacheSettingsAPIService) EdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdGetExecute(r ApiEdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdGetRequest) (*ApplicationCacheGetOneResponse, *http.Response, error) {
	var (
		localVarHTTPMethod   = http.MethodGet
		localVarPostBody     interface{}
		formFiles            []formFile
		localVarReturnValue  *ApplicationCacheGetOneResponse
	)

	localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EdgeApplicationsCacheSettingsAPIService.EdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdGet")
	if err != nil {
		return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
	}

	localVarPath := localBasePath + "/edge_applications/{edge_application_id}/cache_settings/{cache_settings_id}"
	localVarPath = strings.Replace(localVarPath, "{"+"edge_application_id"+"}", url.PathEscape(parameterValueToString(r.edgeApplicationId, "edgeApplicationId")), -1)
	localVarPath = strings.Replace(localVarPath, "{"+"cache_settings_id"+"}", url.PathEscape(parameterValueToString(r.cacheSettingsId, "cacheSettingsId")), -1)

	localVarHeaderParams := make(map[string]string)
	localVarQueryParams := url.Values{}
	localVarFormParams := url.Values{}

	// to determine the Content-Type header
	localVarHTTPContentTypes := []string{}

	// set Content-Type header
	localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
	if localVarHTTPContentType != "" {
		localVarHeaderParams["Content-Type"] = localVarHTTPContentType
	}

	// to determine the Accept header
	localVarHTTPHeaderAccepts := []string{"application/json; version=3"}

	// set Accept header
	localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
	if localVarHTTPHeaderAccept != "" {
		localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
	}
	if r.accept != nil {
		parameterAddToHeaderOrQuery(localVarHeaderParams, "Accept", r.accept, "simple", "")
	}
	if r.ctx != nil {
		// API Key Authentication
		if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok {
			if apiKey, ok := auth["tokenAuth"]; ok {
				var key string
				if apiKey.Prefix != "" {
					key = apiKey.Prefix + " " + apiKey.Key
				} else {
					key = apiKey.Key
				}
				localVarHeaderParams["Authorization"] = key
			}
		}
	}
	req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
	if err != nil {
		return localVarReturnValue, nil, err
	}

	localVarHTTPResponse, err := a.client.callAPI(req)
	if err != nil || localVarHTTPResponse == nil {
		return localVarReturnValue, localVarHTTPResponse, err
	}

	localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
	localVarHTTPResponse.Body.Close()
	localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
	if err != nil {
		return localVarReturnValue, localVarHTTPResponse, err
	}

	if localVarHTTPResponse.StatusCode >= 300 {
		newErr := &GenericOpenAPIError{
			body:  localVarBody,
			error: localVarHTTPResponse.Status,
		}
		return localVarReturnValue, localVarHTTPResponse, newErr
	}

	err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
	if err != nil {
		newErr := &GenericOpenAPIError{
			body:  localVarBody,
			error: err.Error(),
		}
		return localVarReturnValue, localVarHTTPResponse, newErr
	}

	return localVarReturnValue, localVarHTTPResponse, nil
}

type ApiEdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdPatchRequest struct {
	ctx context.Context
	ApiService *EdgeApplicationsCacheSettingsAPIService
	edgeApplicationId int64
	cacheSettingsId int64
	accept *string
	applicationCachePatchRequest *ApplicationCachePatchRequest
}

func (r ApiEdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdPatchRequest) Accept(accept string) ApiEdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdPatchRequest {
	r.accept = &accept
	return r
}

func (r ApiEdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdPatchRequest) ApplicationCachePatchRequest(applicationCachePatchRequest ApplicationCachePatchRequest) ApiEdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdPatchRequest {
	r.applicationCachePatchRequest = &applicationCachePatchRequest
	return r
}

func (r ApiEdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdPatchRequest) Execute() (*ApplicationCachePatchResponse, *http.Response, error) {
	return r.ApiService.EdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdPatchExecute(r)
}

/*
EdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdPatch /edge_applications/:edge_application_id:/cache_settings/:cache_settings_id:

 @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
 @param edgeApplicationId
 @param cacheSettingsId
 @return ApiEdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdPatchRequest
*/
func (a *EdgeApplicationsCacheSettingsAPIService) EdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdPatch(ctx context.Context, edgeApplicationId int64, cacheSettingsId int64) ApiEdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdPatchRequest {
	return ApiEdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdPatchRequest{
		ApiService: a,
		ctx: ctx,
		edgeApplicationId: edgeApplicationId,
		cacheSettingsId: cacheSettingsId,
	}
}

// Execute executes the request
//  @return ApplicationCachePatchResponse
func (a *EdgeApplicationsCacheSettingsAPIService) EdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdPatchExecute(r ApiEdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdPatchRequest) (*ApplicationCachePatchResponse, *http.Response, error) {
	var (
		localVarHTTPMethod   = http.MethodPatch
		localVarPostBody     interface{}
		formFiles            []formFile
		localVarReturnValue  *ApplicationCachePatchResponse
	)

	localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EdgeApplicationsCacheSettingsAPIService.EdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdPatch")
	if err != nil {
		return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
	}

	localVarPath := localBasePath + "/edge_applications/{edge_application_id}/cache_settings/{cache_settings_id}"
	localVarPath = strings.Replace(localVarPath, "{"+"edge_application_id"+"}", url.PathEscape(parameterValueToString(r.edgeApplicationId, "edgeApplicationId")), -1)
	localVarPath = strings.Replace(localVarPath, "{"+"cache_settings_id"+"}", url.PathEscape(parameterValueToString(r.cacheSettingsId, "cacheSettingsId")), -1)

	localVarHeaderParams := make(map[string]string)
	localVarQueryParams := url.Values{}
	localVarFormParams := url.Values{}

	// to determine the Content-Type header
	localVarHTTPContentTypes := []string{"application/json; version=3"}

	// set Content-Type header
	localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
	if localVarHTTPContentType != "" {
		localVarHeaderParams["Content-Type"] = localVarHTTPContentType
	}

	// to determine the Accept header
	localVarHTTPHeaderAccepts := []string{"application/json; version=3"}

	// set Accept header
	localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
	if localVarHTTPHeaderAccept != "" {
		localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
	}
	if r.accept != nil {
		parameterAddToHeaderOrQuery(localVarHeaderParams, "Accept", r.accept, "simple", "")
	}
	// body params
	localVarPostBody = r.applicationCachePatchRequest
	if r.ctx != nil {
		// API Key Authentication
		if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok {
			if apiKey, ok := auth["tokenAuth"]; ok {
				var key string
				if apiKey.Prefix != "" {
					key = apiKey.Prefix + " " + apiKey.Key
				} else {
					key = apiKey.Key
				}
				localVarHeaderParams["Authorization"] = key
			}
		}
	}
	req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
	if err != nil {
		return localVarReturnValue, nil, err
	}

	localVarHTTPResponse, err := a.client.callAPI(req)
	if err != nil || localVarHTTPResponse == nil {
		return localVarReturnValue, localVarHTTPResponse, err
	}

	localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
	localVarHTTPResponse.Body.Close()
	localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
	if err != nil {
		return localVarReturnValue, localVarHTTPResponse, err
	}

	if localVarHTTPResponse.StatusCode >= 300 {
		newErr := &GenericOpenAPIError{
			body:  localVarBody,
			error: localVarHTTPResponse.Status,
		}
		return localVarReturnValue, localVarHTTPResponse, newErr
	}

	err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
	if err != nil {
		newErr := &GenericOpenAPIError{
			body:  localVarBody,
			error: err.Error(),
		}
		return localVarReturnValue, localVarHTTPResponse, newErr
	}

	return localVarReturnValue, localVarHTTPResponse, nil
}

type ApiEdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdPutRequest struct {
	ctx context.Context
	ApiService *EdgeApplicationsCacheSettingsAPIService
	edgeApplicationId int64
	cacheSettingsId int64
	accept *string
	contentType *string
	applicationCachePutRequest *ApplicationCachePutRequest
}

func (r ApiEdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdPutRequest) Accept(accept string) ApiEdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdPutRequest {
	r.accept = &accept
	return r
}

// The type of coding used in the Body (application/json). &lt;br&gt;  Example: Content-Type: application/json
func (r ApiEdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdPutRequest) ContentType(contentType string) ApiEdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdPutRequest {
	r.contentType = &contentType
	return r
}

func (r ApiEdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdPutRequest) ApplicationCachePutRequest(applicationCachePutRequest ApplicationCachePutRequest) ApiEdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdPutRequest {
	r.applicationCachePutRequest = &applicationCachePutRequest
	return r
}

func (r ApiEdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdPutRequest) Execute() (*ApplicationCachePutResponse, *http.Response, error) {
	return r.ApiService.EdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdPutExecute(r)
}

/*
EdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdPut /edge_applications/:edge_application_id:/cache_settings/ca

 @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
 @param edgeApplicationId
 @param cacheSettingsId
 @return ApiEdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdPutRequest
*/
func (a *EdgeApplicationsCacheSettingsAPIService) EdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdPut(ctx context.Context, edgeApplicationId int64, cacheSettingsId int64) ApiEdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdPutRequest {
	return ApiEdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdPutRequest{
		ApiService: a,
		ctx: ctx,
		edgeApplicationId: edgeApplicationId,
		cacheSettingsId: cacheSettingsId,
	}
}

// Execute executes the request
//  @return ApplicationCachePutResponse
func (a *EdgeApplicationsCacheSettingsAPIService) EdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdPutExecute(r ApiEdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdPutRequest) (*ApplicationCachePutResponse, *http.Response, error) {
	var (
		localVarHTTPMethod   = http.MethodPut
		localVarPostBody     interface{}
		formFiles            []formFile
		localVarReturnValue  *ApplicationCachePutResponse
	)

	localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EdgeApplicationsCacheSettingsAPIService.EdgeApplicationsEdgeApplicationIdCacheSettingsCacheSettingsIdPut")
	if err != nil {
		return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
	}

	localVarPath := localBasePath + "/edge_applications/{edge_application_id}/cache_settings/{cache_settings_id}"
	localVarPath = strings.Replace(localVarPath, "{"+"edge_application_id"+"}", url.PathEscape(parameterValueToString(r.edgeApplicationId, "edgeApplicationId")), -1)
	localVarPath = strings.Replace(localVarPath, "{"+"cache_settings_id"+"}", url.PathEscape(parameterValueToString(r.cacheSettingsId, "cacheSettingsId")), -1)

	localVarHeaderParams := make(map[string]string)
	localVarQueryParams := url.Values{}
	localVarFormParams := url.Values{}

	// to determine the Content-Type header
	localVarHTTPContentTypes := []string{"application/json; version=3"}

	// set Content-Type header
	localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
	if localVarHTTPContentType != "" {
		localVarHeaderParams["Content-Type"] = localVarHTTPContentType
	}

	// to determine the Accept header
	localVarHTTPHeaderAccepts := []string{"application/json; version=3"}

	// set Accept header
	localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
	if localVarHTTPHeaderAccept != "" {
		localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
	}
	if r.accept != nil {
		parameterAddToHeaderOrQuery(localVarHeaderParams, "Accept", r.accept, "simple", "")
	}
	if r.contentType != nil {
		parameterAddToHeaderOrQuery(localVarHeaderParams, "Content-Type", r.contentType, "simple", "")
	}
	// body params
	localVarPostBody = r.applicationCachePutRequest
	if r.ctx != nil {
		// API Key Authentication
		if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok {
			if apiKey, ok := auth["tokenAuth"]; ok {
				var key string
				if apiKey.Prefix != "" {
					key = apiKey.Prefix + " " + apiKey.Key
				} else {
					key = apiKey.Key
				}
				localVarHeaderParams["Authorization"] = key
			}
		}
	}
	req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
	if err != nil {
		return localVarReturnValue, nil, err
	}

	localVarHTTPResponse, err := a.client.callAPI(req)
	if err != nil || localVarHTTPResponse == nil {
		return localVarReturnValue, localVarHTTPResponse, err
	}

	localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
	localVarHTTPResponse.Body.Close()
	localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
	if err != nil {
		return localVarReturnValue, localVarHTTPResponse, err
	}

	if localVarHTTPResponse.StatusCode >= 300 {
		newErr := &GenericOpenAPIError{
			body:  localVarBody,
			error: localVarHTTPResponse.Status,
		}
		return localVarReturnValue, localVarHTTPResponse, newErr
	}

	err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
	if err != nil {
		newErr := &GenericOpenAPIError{
			body:  localVarBody,
			error: err.Error(),
		}
		return localVarReturnValue, localVarHTTPResponse, newErr
	}

	return localVarReturnValue, localVarHTTPResponse, nil
}

type ApiEdgeApplicationsEdgeApplicationIdCacheSettingsGetRequest struct {
	ctx context.Context
	ApiService *EdgeApplicationsCacheSettingsAPIService
	edgeApplicationId int64
	page *int64
	pageSize *int64
	filter *string
	orderBy *string
	sort *string
	accept *string
}

func (r ApiEdgeApplicationsEdgeApplicationIdCacheSettingsGetRequest) Page(page int64) ApiEdgeApplicationsEdgeApplicationIdCacheSettingsGetRequest {
	r.page = &page
	return r
}

func (r ApiEdgeApplicationsEdgeApplicationIdCacheSettingsGetRequest) PageSize(pageSize int64) ApiEdgeApplicationsEdgeApplicationIdCacheSettingsGetRequest {
	r.pageSize = &pageSize
	return r
}

func (r ApiEdgeApplicationsEdgeApplicationIdCacheSettingsGetRequest) Filter(filter string) ApiEdgeApplicationsEdgeApplicationIdCacheSettingsGetRequest {
	r.filter = &filter
	return r
}

func (r ApiEdgeApplicationsEdgeApplicationIdCacheSettingsGetRequest) OrderBy(orderBy string) ApiEdgeApplicationsEdgeApplicationIdCacheSettingsGetRequest {
	r.orderBy = &orderBy
	return r
}

func (r ApiEdgeApplicationsEdgeApplicationIdCacheSettingsGetRequest) Sort(sort string) ApiEdgeApplicationsEdgeApplicationIdCacheSettingsGetRequest {
	r.sort = &sort
	return r
}

func (r ApiEdgeApplicationsEdgeApplicationIdCacheSettingsGetRequest) Accept(accept string) ApiEdgeApplicationsEdgeApplicationIdCacheSettingsGetRequest {
	r.accept = &accept
	return r
}

func (r ApiEdgeApplicationsEdgeApplicationIdCacheSettingsGetRequest) Execute() (*ApplicationCacheGetResponse, *http.Response, error) {
	return r.ApiService.EdgeApplicationsEdgeApplicationIdCacheSettingsGetExecute(r)
}

/*
EdgeApplicationsEdgeApplicationIdCacheSettingsGet /edge_applications/{edge_application_id}/cache_settings

 @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
 @param edgeApplicationId
 @return ApiEdgeApplicationsEdgeApplicationIdCacheSettingsGetRequest
*/
func (a *EdgeApplicationsCacheSettingsAPIService) EdgeApplicationsEdgeApplicationIdCacheSettingsGet(ctx context.Context, edgeApplicationId int64) ApiEdgeApplicationsEdgeApplicationIdCacheSettingsGetRequest {
	return ApiEdgeApplicationsEdgeApplicationIdCacheSettingsGetRequest{
		ApiService: a,
		ctx: ctx,
		edgeApplicationId: edgeApplicationId,
	}
}

// Execute executes the request
//  @return ApplicationCacheGetResponse
func (a *EdgeApplicationsCacheSettingsAPIService) EdgeApplicationsEdgeApplicationIdCacheSettingsGetExecute(r ApiEdgeApplicationsEdgeApplicationIdCacheSettingsGetRequest) (*ApplicationCacheGetResponse, *http.Response, error) {
	var (
		localVarHTTPMethod   = http.MethodGet
		localVarPostBody     interface{}
		formFiles            []formFile
		localVarReturnValue  *ApplicationCacheGetResponse
	)

	localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EdgeApplicationsCacheSettingsAPIService.EdgeApplicationsEdgeApplicationIdCacheSettingsGet")
	if err != nil {
		return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
	}

	localVarPath := localBasePath + "/edge_applications/{edge_application_id}/cache_settings"
	localVarPath = strings.Replace(localVarPath, "{"+"edge_application_id"+"}", url.PathEscape(parameterValueToString(r.edgeApplicationId, "edgeApplicationId")), -1)

	localVarHeaderParams := make(map[string]string)
	localVarQueryParams := url.Values{}
	localVarFormParams := url.Values{}

	if r.page != nil {
		parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "")
	}
	if r.pageSize != nil {
		parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "")
	}
	if r.filter != nil {
		parameterAddToHeaderOrQuery(localVarQueryParams, "filter", r.filter, "form", "")
	}
	if r.orderBy != nil {
		parameterAddToHeaderOrQuery(localVarQueryParams, "order_by", r.orderBy, "form", "")
	}
	if r.sort != nil {
		parameterAddToHeaderOrQuery(localVarQueryParams, "sort", r.sort, "form", "")
	}
	// to determine the Content-Type header
	localVarHTTPContentTypes := []string{}

	// set Content-Type header
	localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
	if localVarHTTPContentType != "" {
		localVarHeaderParams["Content-Type"] = localVarHTTPContentType
	}

	// to determine the Accept header
	localVarHTTPHeaderAccepts := []string{"application/json; version=3"}

	// set Accept header
	localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
	if localVarHTTPHeaderAccept != "" {
		localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
	}
	if r.accept != nil {
		parameterAddToHeaderOrQuery(localVarHeaderParams, "Accept", r.accept, "simple", "")
	}
	if r.ctx != nil {
		// API Key Authentication
		if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok {
			if apiKey, ok := auth["tokenAuth"]; ok {
				var key string
				if apiKey.Prefix != "" {
					key = apiKey.Prefix + " " + apiKey.Key
				} else {
					key = apiKey.Key
				}
				localVarHeaderParams["Authorization"] = key
			}
		}
	}
	req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
	if err != nil {
		return localVarReturnValue, nil, err
	}

	localVarHTTPResponse, err := a.client.callAPI(req)
	if err != nil || localVarHTTPResponse == nil {
		return localVarReturnValue, localVarHTTPResponse, err
	}

	localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
	localVarHTTPResponse.Body.Close()
	localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
	if err != nil {
		return localVarReturnValue, localVarHTTPResponse, err
	}

	if localVarHTTPResponse.StatusCode >= 300 {
		newErr := &GenericOpenAPIError{
			body:  localVarBody,
			error: localVarHTTPResponse.Status,
		}
		return localVarReturnValue, localVarHTTPResponse, newErr
	}

	err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
	if err != nil {
		newErr := &GenericOpenAPIError{
			body:  localVarBody,
			error: err.Error(),
		}
		return localVarReturnValue, localVarHTTPResponse, newErr
	}

	return localVarReturnValue, localVarHTTPResponse, nil
}

type ApiEdgeApplicationsEdgeApplicationIdCacheSettingsPostRequest struct {
	ctx context.Context
	ApiService *EdgeApplicationsCacheSettingsAPIService
	edgeApplicationId int64
	accept *string
	contentType *string
	applicationCacheCreateRequest *ApplicationCacheCreateRequest
}

func (r ApiEdgeApplicationsEdgeApplicationIdCacheSettingsPostRequest) Accept(accept string) ApiEdgeApplicationsEdgeApplicationIdCacheSettingsPostRequest {
	r.accept = &accept
	return r
}

// The type of coding used in the Body (application/json). &lt;br&gt;  Example: Content-Type: application/json
func (r ApiEdgeApplicationsEdgeApplicationIdCacheSettingsPostRequest) ContentType(contentType string) ApiEdgeApplicationsEdgeApplicationIdCacheSettingsPostRequest {
	r.contentType = &contentType
	return r
}

func (r ApiEdgeApplicationsEdgeApplicationIdCacheSettingsPostRequest) ApplicationCacheCreateRequest(applicationCacheCreateRequest ApplicationCacheCreateRequest) ApiEdgeApplicationsEdgeApplicationIdCacheSettingsPostRequest {
	r.applicationCacheCreateRequest = &applicationCacheCreateRequest
	return r
}

func (r ApiEdgeApplicationsEdgeApplicationIdCacheSettingsPostRequest) Execute() (*ApplicationCacheCreateResponse, *http.Response, error) {
	return r.ApiService.EdgeApplicationsEdgeApplicationIdCacheSettingsPostExecute(r)
}

/*
EdgeApplicationsEdgeApplicationIdCacheSettingsPost /edge_applications/:edge_application_id:/cache_settings

 @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
 @param edgeApplicationId
 @return ApiEdgeApplicationsEdgeApplicationIdCacheSettingsPostRequest
*/
func (a *EdgeApplicationsCacheSettingsAPIService) EdgeApplicationsEdgeApplicationIdCacheSettingsPost(ctx context.Context, edgeApplicationId int64) ApiEdgeApplicationsEdgeApplicationIdCacheSettingsPostRequest {
	return ApiEdgeApplicationsEdgeApplicationIdCacheSettingsPostRequest{
		ApiService: a,
		ctx: ctx,
		edgeApplicationId: edgeApplicationId,
	}
}

// Execute executes the request
//  @return ApplicationCacheCreateResponse
func (a *EdgeApplicationsCacheSettingsAPIService) EdgeApplicationsEdgeApplicationIdCacheSettingsPostExecute(r ApiEdgeApplicationsEdgeApplicationIdCacheSettingsPostRequest) (*ApplicationCacheCreateResponse, *http.Response, error) {
	var (
		localVarHTTPMethod   = http.MethodPost
		localVarPostBody     interface{}
		formFiles            []formFile
		localVarReturnValue  *ApplicationCacheCreateResponse
	)

	localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EdgeApplicationsCacheSettingsAPIService.EdgeApplicationsEdgeApplicationIdCacheSettingsPost")
	if err != nil {
		return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
	}

	localVarPath := localBasePath + "/edge_applications/{edge_application_id}/cache_settings"
	localVarPath = strings.Replace(localVarPath, "{"+"edge_application_id"+"}", url.PathEscape(parameterValueToString(r.edgeApplicationId, "edgeApplicationId")), -1)

	localVarHeaderParams := make(map[string]string)
	localVarQueryParams := url.Values{}
	localVarFormParams := url.Values{}

	// to determine the Content-Type header
	localVarHTTPContentTypes := []string{"application/json; version=3"}

	// set Content-Type header
	localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
	if localVarHTTPContentType != "" {
		localVarHeaderParams["Content-Type"] = localVarHTTPContentType
	}

	// to determine the Accept header
	localVarHTTPHeaderAccepts := []string{"application/json; version=3"}

	// set Accept header
	localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
	if localVarHTTPHeaderAccept != "" {
		localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
	}
	if r.accept != nil {
		parameterAddToHeaderOrQuery(localVarHeaderParams, "Accept", r.accept, "simple", "")
	}
	if r.contentType != nil {
		parameterAddToHeaderOrQuery(localVarHeaderParams, "Content-Type", r.contentType, "simple", "")
	}
	// body params
	localVarPostBody = r.applicationCacheCreateRequest
	if r.ctx != nil {
		// API Key Authentication
		if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok {
			if apiKey, ok := auth["tokenAuth"]; ok {
				var key string
				if apiKey.Prefix != "" {
					key = apiKey.Prefix + " " + apiKey.Key
				} else {
					key = apiKey.Key
				}
				localVarHeaderParams["Authorization"] = key
			}
		}
	}
	req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
	if err != nil {
		return localVarReturnValue, nil, err
	}

	localVarHTTPResponse, err := a.client.callAPI(req)
	if err != nil || localVarHTTPResponse == nil {
		return localVarReturnValue, localVarHTTPResponse, err
	}

	localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
	localVarHTTPResponse.Body.Close()
	localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
	if err != nil {
		return localVarReturnValue, localVarHTTPResponse, err
	}

	if localVarHTTPResponse.StatusCode >= 300 {
		newErr := &GenericOpenAPIError{
			body:  localVarBody,
			error: localVarHTTPResponse.Status,
		}
		return localVarReturnValue, localVarHTTPResponse, newErr
	}

	err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
	if err != nil {
		newErr := &GenericOpenAPIError{
			body:  localVarBody,
			error: err.Error(),
		}
		return localVarReturnValue, localVarHTTPResponse, newErr
	}

	return localVarReturnValue, localVarHTTPResponse, nil
}
