func (c *FlinkJobManagerClient) executeRequest(ctx context.Context,
	method string, url string, payload interface{}) (*resty.Response, error) {
	client := resty.SetLogger(logger.GetLogWriter(ctx)).SetTimeout(defaultTimeOut)

	var resp *resty.Response
	var err error
	if method == httpGet {
		client.SetTimeout(httpGetTimeOut).SetRetryCount(retryCount)
		resp, err = client.R().Get(url)
	} else if method == httpPatch {
		resp, err = client.R().Patch(url)
	} else if method == httpPost {
		resp, err = client.R().
			SetHeader("Content-Type", "application/json").
			SetBody(payload).
			Post(url)
	} else {
		return nil, errors.New(fmt.Sprintf("Invalid method %s in request", method))
	}
	return resp, err
}
// Helper method to execute the requests
Helper method to execute the requests
// Helper method to execute the requests
func (c *FlinkJobManagerClient) executeRequest(ctx context.Context,
	method string, url string, payload interface{}) (*resty.Response, error) {
	client := resty.SetLogger(logger.GetLogWriter(ctx)).SetTimeout(defaultTimeOut)
	var resp *resty.Response
	var err error
	if method == httpGet {
		client.SetTimeout(httpGetTimeOut).SetRetryCount(retryCount)
		resp, err = client.R().Get(url)
	} else if method == httpPatch {
		resp, err = client.R().Patch(url)
	} else if method == httpPost {
		resp, err = client.R().
			SetHeader("Content-Type", "application/json").
			SetBody(payload).
			Post(url)
	} else {
		return nil, errors.New(fmt.Sprintf("Invalid method %s in request", method))
	}
	return resp, err
}
func ( c * FlinkJobManagerClient ) executeRequest ( ctx context . Context , method string , url string , payload interface { } ) ( * resty . Response , error ) { client := resty . SetLogger ( logger . GetLogWriter ( ctx ) ) . SetTimeout ( defaultTimeOut ) var resp * resty . Response var err error if method == httpGet { client . SetTimeout ( httpGetTimeOut ) . SetRetryCount ( retryCount ) resp , err = client . R ( ) . Get ( url ) } else if method == httpPatch { resp , err = client . R ( ) . Patch ( url ) } else if method == httpPost { resp , err = client . R ( ) . SetHeader ( " " , " " ) . SetBody ( payload ) . Post ( url ) } else { return nil , errors . New ( fmt . Sprintf ( " " , method ) ) } return resp , err }
Helper method to execute the requests
Helper method to execute the requests