From fcdb11901295dbde533337949c007c7724277bf0 Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Tue, 25 Feb 2025 16:49:23 +0000 Subject: [PATCH 1/2] Generate modelserving --- go.work | 1 + .../modelserving/.openapi-generator/VERSION | 1 + services/modelserving/api_default.go | 1328 +++++++++++++++++ services/modelserving/api_default_test.go | 472 ++++++ services/modelserving/client.go | 631 ++++++++ services/modelserving/configuration.go | 41 + services/modelserving/go.mod | 11 + services/modelserving/go.sum | 8 + .../modelserving/model_chat_model_details.go | 467 ++++++ .../model_create_token_payload.go | 183 +++ .../model_create_token_response.go | 146 ++ .../model_embedding_model_details.go | 373 +++++ .../model_error_message_response.go | 152 ++ .../model_get_chat_model_response.go | 146 ++ .../model_get_embeddings_model_resp.go | 146 ++ .../modelserving/model_get_token_response.go | 146 ++ .../model_list_models_response.go | 146 ++ .../modelserving/model_list_token_resp.go | 146 ++ .../modelserving/model_message_response.go | 116 ++ services/modelserving/model_model.go | 373 +++++ .../model_partial_update_token_payload.go | 152 ++ services/modelserving/model_sku.go | 182 +++ services/modelserving/model_token.go | 259 ++++ services/modelserving/model_token_created.go | 287 ++++ .../model_update_token_response.go | 146 ++ services/modelserving/utils.go | 347 +++++ 26 files changed, 6406 insertions(+) create mode 100644 services/modelserving/.openapi-generator/VERSION create mode 100644 services/modelserving/api_default.go create mode 100644 services/modelserving/api_default_test.go create mode 100644 services/modelserving/client.go create mode 100644 services/modelserving/configuration.go create mode 100644 services/modelserving/go.mod create mode 100644 services/modelserving/go.sum create mode 100644 services/modelserving/model_chat_model_details.go create mode 100644 services/modelserving/model_create_token_payload.go create mode 100644 services/modelserving/model_create_token_response.go create mode 100644 services/modelserving/model_embedding_model_details.go create mode 100644 services/modelserving/model_error_message_response.go create mode 100644 services/modelserving/model_get_chat_model_response.go create mode 100644 services/modelserving/model_get_embeddings_model_resp.go create mode 100644 services/modelserving/model_get_token_response.go create mode 100644 services/modelserving/model_list_models_response.go create mode 100644 services/modelserving/model_list_token_resp.go create mode 100644 services/modelserving/model_message_response.go create mode 100644 services/modelserving/model_model.go create mode 100644 services/modelserving/model_partial_update_token_payload.go create mode 100644 services/modelserving/model_sku.go create mode 100644 services/modelserving/model_token.go create mode 100644 services/modelserving/model_token_created.go create mode 100644 services/modelserving/model_update_token_response.go create mode 100644 services/modelserving/utils.go diff --git a/go.work b/go.work index ede5f74cc..3e224617f 100644 --- a/go.work +++ b/go.work @@ -40,6 +40,7 @@ use ( ./services/loadbalancer ./services/logme ./services/mariadb + ./services/modelserving ./services/mongodbflex ./services/objectstorage ./services/observability diff --git a/services/modelserving/.openapi-generator/VERSION b/services/modelserving/.openapi-generator/VERSION new file mode 100644 index 000000000..cd802a1ec --- /dev/null +++ b/services/modelserving/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/services/modelserving/api_default.go b/services/modelserving/api_default.go new file mode 100644 index 000000000..25e9436e4 --- /dev/null +++ b/services/modelserving/api_default.go @@ -0,0 +1,1328 @@ +/* +STACKIT Model Serving API + +This API provides endpoints for the model serving api + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package modelserving + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" + + "github.com/stackitcloud/stackit-sdk-go/core/config" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" +) + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiCreateTokenRequest struct { + ctx context.Context + apiService *DefaultApiService + regionId string + projectId string + createTokenPayload *CreateTokenPayload +} + +func (r ApiCreateTokenRequest) CreateTokenPayload(createTokenPayload CreateTokenPayload) ApiCreateTokenRequest { + r.createTokenPayload = &createTokenPayload + return r +} + +func (r ApiCreateTokenRequest) Execute() (*CreateTokenResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CreateTokenResponse + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateToken") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/regions/{regionId}/tokens" + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createTokenPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorMessageResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorMessageResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v ErrorMessageResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v ErrorMessageResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +CreateToken: create auth token for shared model use + +create auth token for shared model use + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param regionId region name + @param projectId portal project id + @return ApiCreateTokenRequest +*/ +func (a *APIClient) CreateToken(ctx context.Context, regionId string, projectId string) ApiCreateTokenRequest { + return ApiCreateTokenRequest{ + apiService: a.defaultApi, + ctx: ctx, + regionId: regionId, + projectId: projectId, + } +} + +func (a *APIClient) CreateTokenExecute(ctx context.Context, regionId string, projectId string) (*CreateTokenResponse, error) { + r := ApiCreateTokenRequest{ + apiService: a.defaultApi, + ctx: ctx, + regionId: regionId, + projectId: projectId, + } + return r.Execute() +} + +type ApiDeleteTokenRequest struct { + ctx context.Context + apiService *DefaultApiService + regionId string + projectId string + tId string +} + +func (r ApiDeleteTokenRequest) Execute() (*MessageResponse, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *MessageResponse + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteToken") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/regions/{regionId}/tokens/{tId}" + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"tId"+"}", url.PathEscape(ParameterValueToString(r.tId, "tId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorMessageResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorMessageResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorMessageResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v ErrorMessageResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +DeleteToken: delete auth token in shared model use + +delete auth token in shared model use + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param regionId region name + @param projectId portal project id + @param tId token id + @return ApiDeleteTokenRequest +*/ +func (a *APIClient) DeleteToken(ctx context.Context, regionId string, projectId string, tId string) ApiDeleteTokenRequest { + return ApiDeleteTokenRequest{ + apiService: a.defaultApi, + ctx: ctx, + regionId: regionId, + projectId: projectId, + tId: tId, + } +} + +func (a *APIClient) DeleteTokenExecute(ctx context.Context, regionId string, projectId string, tId string) (*MessageResponse, error) { + r := ApiDeleteTokenRequest{ + apiService: a.defaultApi, + ctx: ctx, + regionId: regionId, + projectId: projectId, + tId: tId, + } + return r.Execute() +} + +type ApiGetChatModelRequest struct { + ctx context.Context + apiService *DefaultApiService + regionId string + modelId string +} + +func (r ApiGetChatModelRequest) Execute() (*GetChatModelResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetChatModelResponse + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetChatModel") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/regions/{regionId}/chat/models/{modelId}" + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"modelId"+"}", url.PathEscape(ParameterValueToString(r.modelId, "modelId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorMessageResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorMessageResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v ErrorMessageResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +GetChatModel: details of a llm model + +details of a llm model + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param regionId region name + @param modelId model id + @return ApiGetChatModelRequest +*/ +func (a *APIClient) GetChatModel(ctx context.Context, regionId string, modelId string) ApiGetChatModelRequest { + return ApiGetChatModelRequest{ + apiService: a.defaultApi, + ctx: ctx, + regionId: regionId, + modelId: modelId, + } +} + +func (a *APIClient) GetChatModelExecute(ctx context.Context, regionId string, modelId string) (*GetChatModelResponse, error) { + r := ApiGetChatModelRequest{ + apiService: a.defaultApi, + ctx: ctx, + regionId: regionId, + modelId: modelId, + } + return r.Execute() +} + +type ApiGetEmbeddingModelRequest struct { + ctx context.Context + apiService *DefaultApiService + regionId string + modelId string +} + +func (r ApiGetEmbeddingModelRequest) Execute() (*GetEmbeddingsModelResp, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetEmbeddingsModelResp + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetEmbeddingModel") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/regions/{regionId}/embedding/models/{modelId}" + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"modelId"+"}", url.PathEscape(ParameterValueToString(r.modelId, "modelId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorMessageResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorMessageResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v ErrorMessageResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +GetEmbeddingModel: details of an embedding model + +details of an embedding model + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param regionId region name + @param modelId model id + @return ApiGetEmbeddingModelRequest +*/ +func (a *APIClient) GetEmbeddingModel(ctx context.Context, regionId string, modelId string) ApiGetEmbeddingModelRequest { + return ApiGetEmbeddingModelRequest{ + apiService: a.defaultApi, + ctx: ctx, + regionId: regionId, + modelId: modelId, + } +} + +func (a *APIClient) GetEmbeddingModelExecute(ctx context.Context, regionId string, modelId string) (*GetEmbeddingsModelResp, error) { + r := ApiGetEmbeddingModelRequest{ + apiService: a.defaultApi, + ctx: ctx, + regionId: regionId, + modelId: modelId, + } + return r.Execute() +} + +type ApiGetTokenRequest struct { + ctx context.Context + apiService *DefaultApiService + regionId string + projectId string + tId string +} + +func (r ApiGetTokenRequest) Execute() (*GetTokenResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetTokenResponse + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetToken") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/regions/{regionId}/tokens/{tId}" + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"tId"+"}", url.PathEscape(ParameterValueToString(r.tId, "tId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorMessageResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorMessageResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorMessageResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v ErrorMessageResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +GetToken: get auth token for shared model use + +get auth token for shared model use + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param regionId region name + @param projectId portal project id + @param tId token id + @return ApiGetTokenRequest +*/ +func (a *APIClient) GetToken(ctx context.Context, regionId string, projectId string, tId string) ApiGetTokenRequest { + return ApiGetTokenRequest{ + apiService: a.defaultApi, + ctx: ctx, + regionId: regionId, + projectId: projectId, + tId: tId, + } +} + +func (a *APIClient) GetTokenExecute(ctx context.Context, regionId string, projectId string, tId string) (*GetTokenResponse, error) { + r := ApiGetTokenRequest{ + apiService: a.defaultApi, + ctx: ctx, + regionId: regionId, + projectId: projectId, + tId: tId, + } + return r.Execute() +} + +type ApiListModelsRequest struct { + ctx context.Context + apiService *DefaultApiService + regionId string +} + +func (r ApiListModelsRequest) Execute() (*ListModelsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListModelsResponse + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListModels") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/regions/{regionId}/models" + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorMessageResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorMessageResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v ErrorMessageResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +ListModels: List of shared model + +List of shared model + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param regionId region name + @return ApiListModelsRequest +*/ +func (a *APIClient) ListModels(ctx context.Context, regionId string) ApiListModelsRequest { + return ApiListModelsRequest{ + apiService: a.defaultApi, + ctx: ctx, + regionId: regionId, + } +} + +func (a *APIClient) ListModelsExecute(ctx context.Context, regionId string) (*ListModelsResponse, error) { + r := ApiListModelsRequest{ + apiService: a.defaultApi, + ctx: ctx, + regionId: regionId, + } + return r.Execute() +} + +type ApiListTokensRequest struct { + ctx context.Context + apiService *DefaultApiService + regionId string + projectId string +} + +func (r ApiListTokensRequest) Execute() (*ListTokenResp, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListTokenResp + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListTokens") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/regions/{regionId}/tokens" + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorMessageResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorMessageResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v ErrorMessageResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +ListTokens: auth tokens for shared model in non dedicated instances + +auth tokens for shared model in non dedicated instances + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param regionId region name + @param projectId portal project id + @return ApiListTokensRequest +*/ +func (a *APIClient) ListTokens(ctx context.Context, regionId string, projectId string) ApiListTokensRequest { + return ApiListTokensRequest{ + apiService: a.defaultApi, + ctx: ctx, + regionId: regionId, + projectId: projectId, + } +} + +func (a *APIClient) ListTokensExecute(ctx context.Context, regionId string, projectId string) (*ListTokenResp, error) { + r := ApiListTokensRequest{ + apiService: a.defaultApi, + ctx: ctx, + regionId: regionId, + projectId: projectId, + } + return r.Execute() +} + +type ApiPartialUpdateTokenRequest struct { + ctx context.Context + apiService *DefaultApiService + regionId string + projectId string + tId string + partialUpdateTokenPayload *PartialUpdateTokenPayload +} + +func (r ApiPartialUpdateTokenRequest) PartialUpdateTokenPayload(partialUpdateTokenPayload PartialUpdateTokenPayload) ApiPartialUpdateTokenRequest { + r.partialUpdateTokenPayload = &partialUpdateTokenPayload + return r +} + +func (r ApiPartialUpdateTokenRequest) Execute() (*UpdateTokenResponse, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UpdateTokenResponse + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.PartialUpdateToken") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/regions/{regionId}/tokens/{tId}" + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"tId"+"}", url.PathEscape(ParameterValueToString(r.tId, "tId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.partialUpdateTokenPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorMessageResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorMessageResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorMessageResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v ErrorMessageResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +PartialUpdateToken: partial update auth token for shared model use + +partial update auth token for shared model use + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param regionId region name + @param projectId portal project id + @param tId token id + @return ApiPartialUpdateTokenRequest +*/ +func (a *APIClient) PartialUpdateToken(ctx context.Context, regionId string, projectId string, tId string) ApiPartialUpdateTokenRequest { + return ApiPartialUpdateTokenRequest{ + apiService: a.defaultApi, + ctx: ctx, + regionId: regionId, + projectId: projectId, + tId: tId, + } +} + +func (a *APIClient) PartialUpdateTokenExecute(ctx context.Context, regionId string, projectId string, tId string) (*UpdateTokenResponse, error) { + r := ApiPartialUpdateTokenRequest{ + apiService: a.defaultApi, + ctx: ctx, + regionId: regionId, + projectId: projectId, + tId: tId, + } + return r.Execute() +} diff --git a/services/modelserving/api_default_test.go b/services/modelserving/api_default_test.go new file mode 100644 index 000000000..def50a8b7 --- /dev/null +++ b/services/modelserving/api_default_test.go @@ -0,0 +1,472 @@ +/* +STACKIT Model Serving API + +Testing DefaultApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package modelserving + +import ( + "context" + "encoding/json" + "net/http" + "net/http/httptest" + "net/url" + "strings" + "testing" + + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +func Test_modelserving_DefaultApiService(t *testing.T) { + + t.Run("Test DefaultApiService CreateToken", func(t *testing.T) { + path := "/v1/projects/{projectId}/regions/{regionId}/tokens" + regionIdValue := "regionId" + path = strings.Replace(path, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(regionIdValue, "regionId")), -1) + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := CreateTokenResponse{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for modelserving_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + regionId := "regionId" + projectId := "projectId" + + resp, reqErr := apiClient.CreateToken(context.Background(), regionId, projectId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService DeleteToken", func(t *testing.T) { + path := "/v1/projects/{projectId}/regions/{regionId}/tokens/{tId}" + regionIdValue := "regionId" + path = strings.Replace(path, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(regionIdValue, "regionId")), -1) + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + tIdValue := "tId" + path = strings.Replace(path, "{"+"tId"+"}", url.PathEscape(ParameterValueToString(tIdValue, "tId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := MessageResponse{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for modelserving_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + regionId := "regionId" + projectId := "projectId" + tId := "tId" + + resp, reqErr := apiClient.DeleteToken(context.Background(), regionId, projectId, tId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService GetChatModel", func(t *testing.T) { + path := "/v1/regions/{regionId}/chat/models/{modelId}" + regionIdValue := "regionId" + path = strings.Replace(path, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(regionIdValue, "regionId")), -1) + modelIdValue := "modelId" + path = strings.Replace(path, "{"+"modelId"+"}", url.PathEscape(ParameterValueToString(modelIdValue, "modelId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := GetChatModelResponse{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for modelserving_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + regionId := "regionId" + modelId := "modelId" + + resp, reqErr := apiClient.GetChatModel(context.Background(), regionId, modelId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService GetEmbeddingModel", func(t *testing.T) { + path := "/v1/regions/{regionId}/embedding/models/{modelId}" + regionIdValue := "regionId" + path = strings.Replace(path, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(regionIdValue, "regionId")), -1) + modelIdValue := "modelId" + path = strings.Replace(path, "{"+"modelId"+"}", url.PathEscape(ParameterValueToString(modelIdValue, "modelId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := GetEmbeddingsModelResp{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for modelserving_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + regionId := "regionId" + modelId := "modelId" + + resp, reqErr := apiClient.GetEmbeddingModel(context.Background(), regionId, modelId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService GetToken", func(t *testing.T) { + path := "/v1/projects/{projectId}/regions/{regionId}/tokens/{tId}" + regionIdValue := "regionId" + path = strings.Replace(path, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(regionIdValue, "regionId")), -1) + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + tIdValue := "tId" + path = strings.Replace(path, "{"+"tId"+"}", url.PathEscape(ParameterValueToString(tIdValue, "tId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := GetTokenResponse{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for modelserving_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + regionId := "regionId" + projectId := "projectId" + tId := "tId" + + resp, reqErr := apiClient.GetToken(context.Background(), regionId, projectId, tId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService ListModels", func(t *testing.T) { + path := "/v1/regions/{regionId}/models" + regionIdValue := "regionId" + path = strings.Replace(path, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(regionIdValue, "regionId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := ListModelsResponse{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for modelserving_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + regionId := "regionId" + + resp, reqErr := apiClient.ListModels(context.Background(), regionId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService ListTokens", func(t *testing.T) { + path := "/v1/projects/{projectId}/regions/{regionId}/tokens" + regionIdValue := "regionId" + path = strings.Replace(path, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(regionIdValue, "regionId")), -1) + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := ListTokenResp{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for modelserving_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + regionId := "regionId" + projectId := "projectId" + + resp, reqErr := apiClient.ListTokens(context.Background(), regionId, projectId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService PartialUpdateToken", func(t *testing.T) { + path := "/v1/projects/{projectId}/regions/{regionId}/tokens/{tId}" + regionIdValue := "regionId" + path = strings.Replace(path, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(regionIdValue, "regionId")), -1) + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + tIdValue := "tId" + path = strings.Replace(path, "{"+"tId"+"}", url.PathEscape(ParameterValueToString(tIdValue, "tId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := UpdateTokenResponse{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for modelserving_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + regionId := "regionId" + projectId := "projectId" + tId := "tId" + + resp, reqErr := apiClient.PartialUpdateToken(context.Background(), regionId, projectId, tId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + +} diff --git a/services/modelserving/client.go b/services/modelserving/client.go new file mode 100644 index 000000000..ab9ca0c4c --- /dev/null +++ b/services/modelserving/client.go @@ -0,0 +1,631 @@ +/* +STACKIT Model Serving API + +This API provides endpoints for the model serving api + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package modelserving + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + + "github.com/stackitcloud/stackit-sdk-go/core/auth" + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") +) + +// APIClient manages communication with the STACKIT Model Serving API API v1.0.0 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *config.Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + defaultApi *DefaultApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. +// Optionally receives configuration options +func NewAPIClient(opts ...config.ConfigurationOption) (*APIClient, error) { + cfg := NewConfiguration() + + for _, option := range opts { + err := option(cfg) + if err != nil { + return nil, fmt.Errorf("configuring the client: %w", err) + } + } + + err := config.ConfigureRegion(cfg) + if err != nil { + return nil, fmt.Errorf("configuring region: %w", err) + } + + if cfg.HTTPClient == nil { + cfg.HTTPClient = &http.Client{} + } + + authRoundTripper, err := auth.SetupAuth(cfg) + if err != nil { + return nil, fmt.Errorf("setting up authentication: %w", err) + } + + roundTripper := authRoundTripper + if cfg.Middleware != nil { + roundTripper = config.ChainMiddleware(roundTripper, cfg.Middleware...) + } + + cfg.HTTPClient.Transport = roundTripper + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + c.defaultApi = (*DefaultApiService)(&c.common) + + return c, nil +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func ParameterValueToString(obj interface{}, key string) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param, ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap, err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t, ok := obj.(MappedNullable); ok { + dataMap, err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i := 0; i < lenIndValue; i++ { + var arrayValue = indValue.Index(i) + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, arrayValue.Interface(), collectionType) + } + return + + case reflect.Map: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + iter := indValue.MapRange() + for iter.Next() { + k, v := iter.Key(), iter.Value() + parameterAddToHeaderOrQuery(headerOrQueryParams, fmt.Sprintf("%s[%s]", keyPrefix, k.String()), v.Interface(), collectionType) + } + return + + case reflect.Interface: + fallthrough + case reflect.Ptr: + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, v.Elem().Interface(), collectionType) + return + + case reflect.Int, reflect.Int8, reflect.Int16, + reflect.Int32, reflect.Int64: + value = strconv.FormatInt(v.Int(), 10) + case reflect.Uint, reflect.Uint8, reflect.Uint16, + reflect.Uint32, reflect.Uint64, reflect.Uintptr: + value = strconv.FormatUint(v.Uint(), 10) + case reflect.Float32, reflect.Float64: + value = strconv.FormatFloat(v.Float(), 'g', -1, 32) + case reflect.Bool: + value = strconv.FormatBool(v.Bool()) + case reflect.String: + value = v.String() + default: + value = v.Type().String() + " value" + } + } + + switch valuesMap := headerOrQueryParams.(type) { + case url.Values: + if collectionType == "csv" && valuesMap.Get(keyPrefix) != "" { + valuesMap.Set(keyPrefix, valuesMap.Get(keyPrefix)+","+value) + } else { + valuesMap.Add(keyPrefix, value) + } + break + case map[string]string: + valuesMap[keyPrefix] = value + break + } +} + +// helper for converting interface{} parameters to json strings +func parameterToJson(obj interface{}) (string, error) { + jsonBuf, err := json.Marshal(obj) + if err != nil { + return "", err + } + return string(jsonBuf), err +} + +// callAPI do the request. +func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { + if c.cfg.Debug { + dump, err := httputil.DumpRequestOut(request, true) + if err != nil { + return nil, err + } + log.Printf("\n%s\n", string(dump)) + } + + resp, err := c.cfg.HTTPClient.Do(request) + if err != nil { + return resp, err + } + + if c.cfg.Debug { + dump, err := httputil.DumpResponse(resp, true) + if err != nil { + return resp, err + } + log.Printf("\n%s\n", string(dump)) + } + return resp, err +} + +// Allow modification of underlying config for alternate implementations and testing +// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior +func (c *APIClient) GetConfig() *config.Configuration { + return c.cfg +} + +type formFile struct { + fileBytes []byte + fileName string + formFileName string +} + +// prepareRequest build the request +func (c *APIClient) prepareRequest( + ctx context.Context, + path string, method string, + postBody interface{}, + headerParams map[string]string, + queryParams url.Values, + formParams url.Values, + formFiles []formFile) (localVarRequest *http.Request, err error) { + + var body *bytes.Buffer + + // Detect postBody type and post. + if postBody != nil { + contentType := headerParams["Content-Type"] + if contentType == "" { + contentType = detectContentType(postBody) + headerParams["Content-Type"] = contentType + } + + body, err = setBody(postBody, contentType) + if err != nil { + return nil, err + } + } + + // add form parameters and file if available. + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(formFiles) > 0) { + if body != nil { + return nil, fmt.Errorf("cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, fmt.Errorf("cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return fmt.Errorf("unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return fmt.Errorf("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} diff --git a/services/modelserving/configuration.go b/services/modelserving/configuration.go new file mode 100644 index 000000000..8e47b3b8b --- /dev/null +++ b/services/modelserving/configuration.go @@ -0,0 +1,41 @@ +/* +STACKIT Model Serving API + +This API provides endpoints for the model serving api + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package modelserving + +import ( + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *config.Configuration { + cfg := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: config.ServerConfigurations{ + { + URL: "https://model-serving.api.{region}stackit.cloud", + Description: "No description provided", + Variables: map[string]config.ServerVariable{ + "region": { + Description: "No description provided", + DefaultValue: "eu01.", + EnumValues: []string{ + "eu01.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + return cfg +} diff --git a/services/modelserving/go.mod b/services/modelserving/go.mod new file mode 100644 index 000000000..8f8494db6 --- /dev/null +++ b/services/modelserving/go.mod @@ -0,0 +1,11 @@ +module github.com/stackitcloud/stackit-sdk-go/services/modelserving + +go 1.21 + +require github.com/stackitcloud/stackit-sdk-go/core v0.16.0 + +require ( + github.com/golang-jwt/jwt/v5 v5.2.1 // indirect + github.com/google/go-cmp v0.7.0 // indirect + github.com/google/uuid v1.6.0 // indirect +) diff --git a/services/modelserving/go.sum b/services/modelserving/go.sum new file mode 100644 index 000000000..39bc73464 --- /dev/null +++ b/services/modelserving/go.sum @@ -0,0 +1,8 @@ +github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= +github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/stackitcloud/stackit-sdk-go/core v0.16.0 h1:9caGZwGLZDyBBe6ojk9VR4B2m3/0H5It6znBz76sH1w= +github.com/stackitcloud/stackit-sdk-go/core v0.16.0/go.mod h1:LRheSoXTFRHWAyA8Q9skWtWBp3ZZ+bFAKiKuf4lTDkE= diff --git a/services/modelserving/model_chat_model_details.go b/services/modelserving/model_chat_model_details.go new file mode 100644 index 000000000..cbedd0aba --- /dev/null +++ b/services/modelserving/model_chat_model_details.go @@ -0,0 +1,467 @@ +/* +STACKIT Model Serving API + +This API provides endpoints for the model serving api + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package modelserving + +import ( + "encoding/json" +) + +// checks if the ChatModelDetails type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ChatModelDetails{} + +// ChatModelDetails struct for ChatModelDetails +type ChatModelDetails struct { + // Can be cast to int32 without loss of precision. + Bits *int64 `json:"bits,omitempty"` + // REQUIRED + Category *string `json:"category"` + // REQUIRED + ContextLength *int64 `json:"contextLength"` + // REQUIRED + Description *string `json:"description"` + // REQUIRED + DisplayedName *string `json:"displayedName"` + // generated uuid to identify a model + // REQUIRED + Id *string `json:"id"` + // huggingface name + // REQUIRED + Name *string `json:"name"` + QuantizationMethod *string `json:"quantizationMethod,omitempty"` + // REQUIRED + Region *string `json:"region"` + // model size in bytes + // REQUIRED + Size *int64 `json:"size"` + // REQUIRED + Skus *[]SKU `json:"skus"` + // REQUIRED + Tags *[]string `json:"tags"` + // url of the model + // REQUIRED + Url *string `json:"url"` +} + +type _ChatModelDetails ChatModelDetails + +// NewChatModelDetails instantiates a new ChatModelDetails object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewChatModelDetails(category *string, contextLength *int64, description *string, displayedName *string, id *string, name *string, region *string, size *int64, skus *[]SKU, tags *[]string, url *string) *ChatModelDetails { + this := ChatModelDetails{} + this.Category = category + this.ContextLength = contextLength + this.Description = description + this.DisplayedName = displayedName + this.Id = id + this.Name = name + this.Region = region + this.Size = size + this.Skus = skus + this.Tags = tags + this.Url = url + return &this +} + +// NewChatModelDetailsWithDefaults instantiates a new ChatModelDetails object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewChatModelDetailsWithDefaults() *ChatModelDetails { + this := ChatModelDetails{} + return &this +} + +// GetBits returns the Bits field value if set, zero value otherwise. +func (o *ChatModelDetails) GetBits() *int64 { + if o == nil || IsNil(o.Bits) { + var ret *int64 + return ret + } + return o.Bits +} + +// GetBitsOk returns a tuple with the Bits field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ChatModelDetails) GetBitsOk() (*int64, bool) { + if o == nil || IsNil(o.Bits) { + return nil, false + } + return o.Bits, true +} + +// HasBits returns a boolean if a field has been set. +func (o *ChatModelDetails) HasBits() bool { + if o != nil && !IsNil(o.Bits) { + return true + } + + return false +} + +// SetBits gets a reference to the given int64 and assigns it to the Bits field. +func (o *ChatModelDetails) SetBits(v *int64) { + o.Bits = v +} + +// GetCategory returns the Category field value +func (o *ChatModelDetails) GetCategory() *string { + if o == nil || IsNil(o.Category) { + var ret *string + return ret + } + + return o.Category +} + +// GetCategoryOk returns a tuple with the Category field value +// and a boolean to check if the value has been set. +func (o *ChatModelDetails) GetCategoryOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Category, true +} + +// SetCategory sets field value +func (o *ChatModelDetails) SetCategory(v *string) { + o.Category = v +} + +// GetContextLength returns the ContextLength field value +func (o *ChatModelDetails) GetContextLength() *int64 { + if o == nil || IsNil(o.ContextLength) { + var ret *int64 + return ret + } + + return o.ContextLength +} + +// GetContextLengthOk returns a tuple with the ContextLength field value +// and a boolean to check if the value has been set. +func (o *ChatModelDetails) GetContextLengthOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.ContextLength, true +} + +// SetContextLength sets field value +func (o *ChatModelDetails) SetContextLength(v *int64) { + o.ContextLength = v +} + +// GetDescription returns the Description field value +func (o *ChatModelDetails) GetDescription() *string { + if o == nil || IsNil(o.Description) { + var ret *string + return ret + } + + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *ChatModelDetails) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Description, true +} + +// SetDescription sets field value +func (o *ChatModelDetails) SetDescription(v *string) { + o.Description = v +} + +// GetDisplayedName returns the DisplayedName field value +func (o *ChatModelDetails) GetDisplayedName() *string { + if o == nil || IsNil(o.DisplayedName) { + var ret *string + return ret + } + + return o.DisplayedName +} + +// GetDisplayedNameOk returns a tuple with the DisplayedName field value +// and a boolean to check if the value has been set. +func (o *ChatModelDetails) GetDisplayedNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.DisplayedName, true +} + +// SetDisplayedName sets field value +func (o *ChatModelDetails) SetDisplayedName(v *string) { + o.DisplayedName = v +} + +// GetId returns the Id field value +func (o *ChatModelDetails) GetId() *string { + if o == nil || IsNil(o.Id) { + var ret *string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ChatModelDetails) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Id, true +} + +// SetId sets field value +func (o *ChatModelDetails) SetId(v *string) { + o.Id = v +} + +// GetName returns the Name field value +func (o *ChatModelDetails) GetName() *string { + if o == nil || IsNil(o.Name) { + var ret *string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ChatModelDetails) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Name, true +} + +// SetName sets field value +func (o *ChatModelDetails) SetName(v *string) { + o.Name = v +} + +// GetQuantizationMethod returns the QuantizationMethod field value if set, zero value otherwise. +func (o *ChatModelDetails) GetQuantizationMethod() *string { + if o == nil || IsNil(o.QuantizationMethod) { + var ret *string + return ret + } + return o.QuantizationMethod +} + +// GetQuantizationMethodOk returns a tuple with the QuantizationMethod field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ChatModelDetails) GetQuantizationMethodOk() (*string, bool) { + if o == nil || IsNil(o.QuantizationMethod) { + return nil, false + } + return o.QuantizationMethod, true +} + +// HasQuantizationMethod returns a boolean if a field has been set. +func (o *ChatModelDetails) HasQuantizationMethod() bool { + if o != nil && !IsNil(o.QuantizationMethod) { + return true + } + + return false +} + +// SetQuantizationMethod gets a reference to the given string and assigns it to the QuantizationMethod field. +func (o *ChatModelDetails) SetQuantizationMethod(v *string) { + o.QuantizationMethod = v +} + +// GetRegion returns the Region field value +func (o *ChatModelDetails) GetRegion() *string { + if o == nil || IsNil(o.Region) { + var ret *string + return ret + } + + return o.Region +} + +// GetRegionOk returns a tuple with the Region field value +// and a boolean to check if the value has been set. +func (o *ChatModelDetails) GetRegionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Region, true +} + +// SetRegion sets field value +func (o *ChatModelDetails) SetRegion(v *string) { + o.Region = v +} + +// GetSize returns the Size field value +func (o *ChatModelDetails) GetSize() *int64 { + if o == nil || IsNil(o.Size) { + var ret *int64 + return ret + } + + return o.Size +} + +// GetSizeOk returns a tuple with the Size field value +// and a boolean to check if the value has been set. +func (o *ChatModelDetails) GetSizeOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.Size, true +} + +// SetSize sets field value +func (o *ChatModelDetails) SetSize(v *int64) { + o.Size = v +} + +// GetSkus returns the Skus field value +func (o *ChatModelDetails) GetSkus() *[]SKU { + if o == nil || IsNil(o.Skus) { + var ret *[]SKU + return ret + } + + return o.Skus +} + +// GetSkusOk returns a tuple with the Skus field value +// and a boolean to check if the value has been set. +func (o *ChatModelDetails) GetSkusOk() (*[]SKU, bool) { + if o == nil { + return nil, false + } + return o.Skus, true +} + +// SetSkus sets field value +func (o *ChatModelDetails) SetSkus(v *[]SKU) { + o.Skus = v +} + +// GetTags returns the Tags field value +func (o *ChatModelDetails) GetTags() *[]string { + if o == nil || IsNil(o.Tags) { + var ret *[]string + return ret + } + + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value +// and a boolean to check if the value has been set. +func (o *ChatModelDetails) GetTagsOk() (*[]string, bool) { + if o == nil { + return nil, false + } + return o.Tags, true +} + +// SetTags sets field value +func (o *ChatModelDetails) SetTags(v *[]string) { + o.Tags = v +} + +// GetUrl returns the Url field value +func (o *ChatModelDetails) GetUrl() *string { + if o == nil || IsNil(o.Url) { + var ret *string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *ChatModelDetails) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Url, true +} + +// SetUrl sets field value +func (o *ChatModelDetails) SetUrl(v *string) { + o.Url = v +} + +func (o ChatModelDetails) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Bits) { + toSerialize["bits"] = o.Bits + } + toSerialize["category"] = o.Category + toSerialize["contextLength"] = o.ContextLength + toSerialize["description"] = o.Description + toSerialize["displayedName"] = o.DisplayedName + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + if !IsNil(o.QuantizationMethod) { + toSerialize["quantizationMethod"] = o.QuantizationMethod + } + toSerialize["region"] = o.Region + toSerialize["size"] = o.Size + toSerialize["skus"] = o.Skus + toSerialize["tags"] = o.Tags + toSerialize["url"] = o.Url + return toSerialize, nil +} + +type NullableChatModelDetails struct { + value *ChatModelDetails + isSet bool +} + +func (v NullableChatModelDetails) Get() *ChatModelDetails { + return v.value +} + +func (v *NullableChatModelDetails) Set(val *ChatModelDetails) { + v.value = val + v.isSet = true +} + +func (v NullableChatModelDetails) IsSet() bool { + return v.isSet +} + +func (v *NullableChatModelDetails) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableChatModelDetails(val *ChatModelDetails) *NullableChatModelDetails { + return &NullableChatModelDetails{value: val, isSet: true} +} + +func (v NullableChatModelDetails) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableChatModelDetails) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/modelserving/model_create_token_payload.go b/services/modelserving/model_create_token_payload.go new file mode 100644 index 000000000..92dda9897 --- /dev/null +++ b/services/modelserving/model_create_token_payload.go @@ -0,0 +1,183 @@ +/* +STACKIT Model Serving API + +This API provides endpoints for the model serving api + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package modelserving + +import ( + "encoding/json" +) + +// checks if the CreateTokenPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateTokenPayload{} + +// CreateTokenPayload struct for CreateTokenPayload +type CreateTokenPayload struct { + Description *string `json:"description,omitempty"` + // REQUIRED + Name *string `json:"name"` + // time to live duration. Must be valid duration string. If not set the token will never expire. + TtlDuration *string `json:"ttlDuration,omitempty"` +} + +type _CreateTokenPayload CreateTokenPayload + +// NewCreateTokenPayload instantiates a new CreateTokenPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateTokenPayload(name *string) *CreateTokenPayload { + this := CreateTokenPayload{} + this.Name = name + return &this +} + +// NewCreateTokenPayloadWithDefaults instantiates a new CreateTokenPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateTokenPayloadWithDefaults() *CreateTokenPayload { + this := CreateTokenPayload{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *CreateTokenPayload) GetDescription() *string { + if o == nil || IsNil(o.Description) { + var ret *string + return ret + } + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateTokenPayload) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *CreateTokenPayload) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *CreateTokenPayload) SetDescription(v *string) { + o.Description = v +} + +// GetName returns the Name field value +func (o *CreateTokenPayload) GetName() *string { + if o == nil || IsNil(o.Name) { + var ret *string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CreateTokenPayload) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Name, true +} + +// SetName sets field value +func (o *CreateTokenPayload) SetName(v *string) { + o.Name = v +} + +// GetTtlDuration returns the TtlDuration field value if set, zero value otherwise. +func (o *CreateTokenPayload) GetTtlDuration() *string { + if o == nil || IsNil(o.TtlDuration) { + var ret *string + return ret + } + return o.TtlDuration +} + +// GetTtlDurationOk returns a tuple with the TtlDuration field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateTokenPayload) GetTtlDurationOk() (*string, bool) { + if o == nil || IsNil(o.TtlDuration) { + return nil, false + } + return o.TtlDuration, true +} + +// HasTtlDuration returns a boolean if a field has been set. +func (o *CreateTokenPayload) HasTtlDuration() bool { + if o != nil && !IsNil(o.TtlDuration) { + return true + } + + return false +} + +// SetTtlDuration gets a reference to the given string and assigns it to the TtlDuration field. +func (o *CreateTokenPayload) SetTtlDuration(v *string) { + o.TtlDuration = v +} + +func (o CreateTokenPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["name"] = o.Name + if !IsNil(o.TtlDuration) { + toSerialize["ttlDuration"] = o.TtlDuration + } + return toSerialize, nil +} + +type NullableCreateTokenPayload struct { + value *CreateTokenPayload + isSet bool +} + +func (v NullableCreateTokenPayload) Get() *CreateTokenPayload { + return v.value +} + +func (v *NullableCreateTokenPayload) Set(val *CreateTokenPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateTokenPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateTokenPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateTokenPayload(val *CreateTokenPayload) *NullableCreateTokenPayload { + return &NullableCreateTokenPayload{value: val, isSet: true} +} + +func (v NullableCreateTokenPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateTokenPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/modelserving/model_create_token_response.go b/services/modelserving/model_create_token_response.go new file mode 100644 index 000000000..13ce97dc9 --- /dev/null +++ b/services/modelserving/model_create_token_response.go @@ -0,0 +1,146 @@ +/* +STACKIT Model Serving API + +This API provides endpoints for the model serving api + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package modelserving + +import ( + "encoding/json" +) + +// checks if the CreateTokenResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateTokenResponse{} + +// CreateTokenResponse struct for CreateTokenResponse +type CreateTokenResponse struct { + Message *string `json:"message,omitempty"` + // REQUIRED + Token *TokenCreated `json:"token"` +} + +type _CreateTokenResponse CreateTokenResponse + +// NewCreateTokenResponse instantiates a new CreateTokenResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateTokenResponse(token *TokenCreated) *CreateTokenResponse { + this := CreateTokenResponse{} + this.Token = token + return &this +} + +// NewCreateTokenResponseWithDefaults instantiates a new CreateTokenResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateTokenResponseWithDefaults() *CreateTokenResponse { + this := CreateTokenResponse{} + return &this +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *CreateTokenResponse) GetMessage() *string { + if o == nil || IsNil(o.Message) { + var ret *string + return ret + } + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateTokenResponse) GetMessageOk() (*string, bool) { + if o == nil || IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *CreateTokenResponse) HasMessage() bool { + if o != nil && !IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *CreateTokenResponse) SetMessage(v *string) { + o.Message = v +} + +// GetToken returns the Token field value +func (o *CreateTokenResponse) GetToken() *TokenCreated { + if o == nil || IsNil(o.Token) { + var ret *TokenCreated + return ret + } + + return o.Token +} + +// GetTokenOk returns a tuple with the Token field value +// and a boolean to check if the value has been set. +func (o *CreateTokenResponse) GetTokenOk() (*TokenCreated, bool) { + if o == nil { + return nil, false + } + return o.Token, true +} + +// SetToken sets field value +func (o *CreateTokenResponse) SetToken(v *TokenCreated) { + o.Token = v +} + +func (o CreateTokenResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Message) { + toSerialize["message"] = o.Message + } + toSerialize["token"] = o.Token + return toSerialize, nil +} + +type NullableCreateTokenResponse struct { + value *CreateTokenResponse + isSet bool +} + +func (v NullableCreateTokenResponse) Get() *CreateTokenResponse { + return v.value +} + +func (v *NullableCreateTokenResponse) Set(val *CreateTokenResponse) { + v.value = val + v.isSet = true +} + +func (v NullableCreateTokenResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateTokenResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateTokenResponse(val *CreateTokenResponse) *NullableCreateTokenResponse { + return &NullableCreateTokenResponse{value: val, isSet: true} +} + +func (v NullableCreateTokenResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateTokenResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/modelserving/model_embedding_model_details.go b/services/modelserving/model_embedding_model_details.go new file mode 100644 index 000000000..e30fbd138 --- /dev/null +++ b/services/modelserving/model_embedding_model_details.go @@ -0,0 +1,373 @@ +/* +STACKIT Model Serving API + +This API provides endpoints for the model serving api + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package modelserving + +import ( + "encoding/json" +) + +// checks if the EmbeddingModelDetails type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EmbeddingModelDetails{} + +// EmbeddingModelDetails struct for EmbeddingModelDetails +type EmbeddingModelDetails struct { + // REQUIRED + Category *string `json:"category"` + // REQUIRED + Description *string `json:"description"` + // REQUIRED + DisplayedName *string `json:"displayedName"` + // generated uuid to identify a model + // REQUIRED + Id *string `json:"id"` + // huggingface name + // REQUIRED + Name *string `json:"name"` + // REQUIRED + OutputDimension *int64 `json:"outputDimension"` + // REQUIRED + Region *string `json:"region"` + // REQUIRED + Skus *[]SKU `json:"skus"` + Tags *[]string `json:"tags,omitempty"` + // url of the model + // REQUIRED + Url *string `json:"url"` +} + +type _EmbeddingModelDetails EmbeddingModelDetails + +// NewEmbeddingModelDetails instantiates a new EmbeddingModelDetails object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEmbeddingModelDetails(category *string, description *string, displayedName *string, id *string, name *string, outputDimension *int64, region *string, skus *[]SKU, url *string) *EmbeddingModelDetails { + this := EmbeddingModelDetails{} + this.Category = category + this.Description = description + this.DisplayedName = displayedName + this.Id = id + this.Name = name + this.OutputDimension = outputDimension + this.Region = region + this.Skus = skus + this.Url = url + return &this +} + +// NewEmbeddingModelDetailsWithDefaults instantiates a new EmbeddingModelDetails object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEmbeddingModelDetailsWithDefaults() *EmbeddingModelDetails { + this := EmbeddingModelDetails{} + return &this +} + +// GetCategory returns the Category field value +func (o *EmbeddingModelDetails) GetCategory() *string { + if o == nil || IsNil(o.Category) { + var ret *string + return ret + } + + return o.Category +} + +// GetCategoryOk returns a tuple with the Category field value +// and a boolean to check if the value has been set. +func (o *EmbeddingModelDetails) GetCategoryOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Category, true +} + +// SetCategory sets field value +func (o *EmbeddingModelDetails) SetCategory(v *string) { + o.Category = v +} + +// GetDescription returns the Description field value +func (o *EmbeddingModelDetails) GetDescription() *string { + if o == nil || IsNil(o.Description) { + var ret *string + return ret + } + + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *EmbeddingModelDetails) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Description, true +} + +// SetDescription sets field value +func (o *EmbeddingModelDetails) SetDescription(v *string) { + o.Description = v +} + +// GetDisplayedName returns the DisplayedName field value +func (o *EmbeddingModelDetails) GetDisplayedName() *string { + if o == nil || IsNil(o.DisplayedName) { + var ret *string + return ret + } + + return o.DisplayedName +} + +// GetDisplayedNameOk returns a tuple with the DisplayedName field value +// and a boolean to check if the value has been set. +func (o *EmbeddingModelDetails) GetDisplayedNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.DisplayedName, true +} + +// SetDisplayedName sets field value +func (o *EmbeddingModelDetails) SetDisplayedName(v *string) { + o.DisplayedName = v +} + +// GetId returns the Id field value +func (o *EmbeddingModelDetails) GetId() *string { + if o == nil || IsNil(o.Id) { + var ret *string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *EmbeddingModelDetails) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Id, true +} + +// SetId sets field value +func (o *EmbeddingModelDetails) SetId(v *string) { + o.Id = v +} + +// GetName returns the Name field value +func (o *EmbeddingModelDetails) GetName() *string { + if o == nil || IsNil(o.Name) { + var ret *string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *EmbeddingModelDetails) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Name, true +} + +// SetName sets field value +func (o *EmbeddingModelDetails) SetName(v *string) { + o.Name = v +} + +// GetOutputDimension returns the OutputDimension field value +func (o *EmbeddingModelDetails) GetOutputDimension() *int64 { + if o == nil || IsNil(o.OutputDimension) { + var ret *int64 + return ret + } + + return o.OutputDimension +} + +// GetOutputDimensionOk returns a tuple with the OutputDimension field value +// and a boolean to check if the value has been set. +func (o *EmbeddingModelDetails) GetOutputDimensionOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.OutputDimension, true +} + +// SetOutputDimension sets field value +func (o *EmbeddingModelDetails) SetOutputDimension(v *int64) { + o.OutputDimension = v +} + +// GetRegion returns the Region field value +func (o *EmbeddingModelDetails) GetRegion() *string { + if o == nil || IsNil(o.Region) { + var ret *string + return ret + } + + return o.Region +} + +// GetRegionOk returns a tuple with the Region field value +// and a boolean to check if the value has been set. +func (o *EmbeddingModelDetails) GetRegionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Region, true +} + +// SetRegion sets field value +func (o *EmbeddingModelDetails) SetRegion(v *string) { + o.Region = v +} + +// GetSkus returns the Skus field value +func (o *EmbeddingModelDetails) GetSkus() *[]SKU { + if o == nil || IsNil(o.Skus) { + var ret *[]SKU + return ret + } + + return o.Skus +} + +// GetSkusOk returns a tuple with the Skus field value +// and a boolean to check if the value has been set. +func (o *EmbeddingModelDetails) GetSkusOk() (*[]SKU, bool) { + if o == nil { + return nil, false + } + return o.Skus, true +} + +// SetSkus sets field value +func (o *EmbeddingModelDetails) SetSkus(v *[]SKU) { + o.Skus = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *EmbeddingModelDetails) GetTags() *[]string { + if o == nil || IsNil(o.Tags) { + var ret *[]string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EmbeddingModelDetails) GetTagsOk() (*[]string, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *EmbeddingModelDetails) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *EmbeddingModelDetails) SetTags(v *[]string) { + o.Tags = v +} + +// GetUrl returns the Url field value +func (o *EmbeddingModelDetails) GetUrl() *string { + if o == nil || IsNil(o.Url) { + var ret *string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *EmbeddingModelDetails) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Url, true +} + +// SetUrl sets field value +func (o *EmbeddingModelDetails) SetUrl(v *string) { + o.Url = v +} + +func (o EmbeddingModelDetails) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["category"] = o.Category + toSerialize["description"] = o.Description + toSerialize["displayedName"] = o.DisplayedName + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + toSerialize["outputDimension"] = o.OutputDimension + toSerialize["region"] = o.Region + toSerialize["skus"] = o.Skus + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + toSerialize["url"] = o.Url + return toSerialize, nil +} + +type NullableEmbeddingModelDetails struct { + value *EmbeddingModelDetails + isSet bool +} + +func (v NullableEmbeddingModelDetails) Get() *EmbeddingModelDetails { + return v.value +} + +func (v *NullableEmbeddingModelDetails) Set(val *EmbeddingModelDetails) { + v.value = val + v.isSet = true +} + +func (v NullableEmbeddingModelDetails) IsSet() bool { + return v.isSet +} + +func (v *NullableEmbeddingModelDetails) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEmbeddingModelDetails(val *EmbeddingModelDetails) *NullableEmbeddingModelDetails { + return &NullableEmbeddingModelDetails{value: val, isSet: true} +} + +func (v NullableEmbeddingModelDetails) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEmbeddingModelDetails) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/modelserving/model_error_message_response.go b/services/modelserving/model_error_message_response.go new file mode 100644 index 000000000..9ec6a8487 --- /dev/null +++ b/services/modelserving/model_error_message_response.go @@ -0,0 +1,152 @@ +/* +STACKIT Model Serving API + +This API provides endpoints for the model serving api + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package modelserving + +import ( + "encoding/json" +) + +// checks if the ErrorMessageResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ErrorMessageResponse{} + +// ErrorMessageResponse struct for ErrorMessageResponse +type ErrorMessageResponse struct { + Error *string `json:"error,omitempty"` + Message *string `json:"message,omitempty"` +} + +// NewErrorMessageResponse instantiates a new ErrorMessageResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewErrorMessageResponse() *ErrorMessageResponse { + this := ErrorMessageResponse{} + return &this +} + +// NewErrorMessageResponseWithDefaults instantiates a new ErrorMessageResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewErrorMessageResponseWithDefaults() *ErrorMessageResponse { + this := ErrorMessageResponse{} + return &this +} + +// GetError returns the Error field value if set, zero value otherwise. +func (o *ErrorMessageResponse) GetError() *string { + if o == nil || IsNil(o.Error) { + var ret *string + return ret + } + return o.Error +} + +// GetErrorOk returns a tuple with the Error field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ErrorMessageResponse) GetErrorOk() (*string, bool) { + if o == nil || IsNil(o.Error) { + return nil, false + } + return o.Error, true +} + +// HasError returns a boolean if a field has been set. +func (o *ErrorMessageResponse) HasError() bool { + if o != nil && !IsNil(o.Error) { + return true + } + + return false +} + +// SetError gets a reference to the given string and assigns it to the Error field. +func (o *ErrorMessageResponse) SetError(v *string) { + o.Error = v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *ErrorMessageResponse) GetMessage() *string { + if o == nil || IsNil(o.Message) { + var ret *string + return ret + } + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ErrorMessageResponse) GetMessageOk() (*string, bool) { + if o == nil || IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *ErrorMessageResponse) HasMessage() bool { + if o != nil && !IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *ErrorMessageResponse) SetMessage(v *string) { + o.Message = v +} + +func (o ErrorMessageResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Error) { + toSerialize["error"] = o.Error + } + if !IsNil(o.Message) { + toSerialize["message"] = o.Message + } + return toSerialize, nil +} + +type NullableErrorMessageResponse struct { + value *ErrorMessageResponse + isSet bool +} + +func (v NullableErrorMessageResponse) Get() *ErrorMessageResponse { + return v.value +} + +func (v *NullableErrorMessageResponse) Set(val *ErrorMessageResponse) { + v.value = val + v.isSet = true +} + +func (v NullableErrorMessageResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableErrorMessageResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableErrorMessageResponse(val *ErrorMessageResponse) *NullableErrorMessageResponse { + return &NullableErrorMessageResponse{value: val, isSet: true} +} + +func (v NullableErrorMessageResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableErrorMessageResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/modelserving/model_get_chat_model_response.go b/services/modelserving/model_get_chat_model_response.go new file mode 100644 index 000000000..5c87d065f --- /dev/null +++ b/services/modelserving/model_get_chat_model_response.go @@ -0,0 +1,146 @@ +/* +STACKIT Model Serving API + +This API provides endpoints for the model serving api + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package modelserving + +import ( + "encoding/json" +) + +// checks if the GetChatModelResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetChatModelResponse{} + +// GetChatModelResponse struct for GetChatModelResponse +type GetChatModelResponse struct { + Message *string `json:"message,omitempty"` + // REQUIRED + Model *ChatModelDetails `json:"model"` +} + +type _GetChatModelResponse GetChatModelResponse + +// NewGetChatModelResponse instantiates a new GetChatModelResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetChatModelResponse(model *ChatModelDetails) *GetChatModelResponse { + this := GetChatModelResponse{} + this.Model = model + return &this +} + +// NewGetChatModelResponseWithDefaults instantiates a new GetChatModelResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetChatModelResponseWithDefaults() *GetChatModelResponse { + this := GetChatModelResponse{} + return &this +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *GetChatModelResponse) GetMessage() *string { + if o == nil || IsNil(o.Message) { + var ret *string + return ret + } + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetChatModelResponse) GetMessageOk() (*string, bool) { + if o == nil || IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *GetChatModelResponse) HasMessage() bool { + if o != nil && !IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *GetChatModelResponse) SetMessage(v *string) { + o.Message = v +} + +// GetModel returns the Model field value +func (o *GetChatModelResponse) GetModel() *ChatModelDetails { + if o == nil || IsNil(o.Model) { + var ret *ChatModelDetails + return ret + } + + return o.Model +} + +// GetModelOk returns a tuple with the Model field value +// and a boolean to check if the value has been set. +func (o *GetChatModelResponse) GetModelOk() (*ChatModelDetails, bool) { + if o == nil { + return nil, false + } + return o.Model, true +} + +// SetModel sets field value +func (o *GetChatModelResponse) SetModel(v *ChatModelDetails) { + o.Model = v +} + +func (o GetChatModelResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Message) { + toSerialize["message"] = o.Message + } + toSerialize["model"] = o.Model + return toSerialize, nil +} + +type NullableGetChatModelResponse struct { + value *GetChatModelResponse + isSet bool +} + +func (v NullableGetChatModelResponse) Get() *GetChatModelResponse { + return v.value +} + +func (v *NullableGetChatModelResponse) Set(val *GetChatModelResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetChatModelResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetChatModelResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetChatModelResponse(val *GetChatModelResponse) *NullableGetChatModelResponse { + return &NullableGetChatModelResponse{value: val, isSet: true} +} + +func (v NullableGetChatModelResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetChatModelResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/modelserving/model_get_embeddings_model_resp.go b/services/modelserving/model_get_embeddings_model_resp.go new file mode 100644 index 000000000..94e6d06cc --- /dev/null +++ b/services/modelserving/model_get_embeddings_model_resp.go @@ -0,0 +1,146 @@ +/* +STACKIT Model Serving API + +This API provides endpoints for the model serving api + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package modelserving + +import ( + "encoding/json" +) + +// checks if the GetEmbeddingsModelResp type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetEmbeddingsModelResp{} + +// GetEmbeddingsModelResp struct for GetEmbeddingsModelResp +type GetEmbeddingsModelResp struct { + Message *string `json:"message,omitempty"` + // REQUIRED + Model *EmbeddingModelDetails `json:"model"` +} + +type _GetEmbeddingsModelResp GetEmbeddingsModelResp + +// NewGetEmbeddingsModelResp instantiates a new GetEmbeddingsModelResp object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetEmbeddingsModelResp(model *EmbeddingModelDetails) *GetEmbeddingsModelResp { + this := GetEmbeddingsModelResp{} + this.Model = model + return &this +} + +// NewGetEmbeddingsModelRespWithDefaults instantiates a new GetEmbeddingsModelResp object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetEmbeddingsModelRespWithDefaults() *GetEmbeddingsModelResp { + this := GetEmbeddingsModelResp{} + return &this +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *GetEmbeddingsModelResp) GetMessage() *string { + if o == nil || IsNil(o.Message) { + var ret *string + return ret + } + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetEmbeddingsModelResp) GetMessageOk() (*string, bool) { + if o == nil || IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *GetEmbeddingsModelResp) HasMessage() bool { + if o != nil && !IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *GetEmbeddingsModelResp) SetMessage(v *string) { + o.Message = v +} + +// GetModel returns the Model field value +func (o *GetEmbeddingsModelResp) GetModel() *EmbeddingModelDetails { + if o == nil || IsNil(o.Model) { + var ret *EmbeddingModelDetails + return ret + } + + return o.Model +} + +// GetModelOk returns a tuple with the Model field value +// and a boolean to check if the value has been set. +func (o *GetEmbeddingsModelResp) GetModelOk() (*EmbeddingModelDetails, bool) { + if o == nil { + return nil, false + } + return o.Model, true +} + +// SetModel sets field value +func (o *GetEmbeddingsModelResp) SetModel(v *EmbeddingModelDetails) { + o.Model = v +} + +func (o GetEmbeddingsModelResp) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Message) { + toSerialize["message"] = o.Message + } + toSerialize["model"] = o.Model + return toSerialize, nil +} + +type NullableGetEmbeddingsModelResp struct { + value *GetEmbeddingsModelResp + isSet bool +} + +func (v NullableGetEmbeddingsModelResp) Get() *GetEmbeddingsModelResp { + return v.value +} + +func (v *NullableGetEmbeddingsModelResp) Set(val *GetEmbeddingsModelResp) { + v.value = val + v.isSet = true +} + +func (v NullableGetEmbeddingsModelResp) IsSet() bool { + return v.isSet +} + +func (v *NullableGetEmbeddingsModelResp) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetEmbeddingsModelResp(val *GetEmbeddingsModelResp) *NullableGetEmbeddingsModelResp { + return &NullableGetEmbeddingsModelResp{value: val, isSet: true} +} + +func (v NullableGetEmbeddingsModelResp) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetEmbeddingsModelResp) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/modelserving/model_get_token_response.go b/services/modelserving/model_get_token_response.go new file mode 100644 index 000000000..1d8b63e1c --- /dev/null +++ b/services/modelserving/model_get_token_response.go @@ -0,0 +1,146 @@ +/* +STACKIT Model Serving API + +This API provides endpoints for the model serving api + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package modelserving + +import ( + "encoding/json" +) + +// checks if the GetTokenResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetTokenResponse{} + +// GetTokenResponse struct for GetTokenResponse +type GetTokenResponse struct { + Message *string `json:"message,omitempty"` + // REQUIRED + Token *Token `json:"token"` +} + +type _GetTokenResponse GetTokenResponse + +// NewGetTokenResponse instantiates a new GetTokenResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetTokenResponse(token *Token) *GetTokenResponse { + this := GetTokenResponse{} + this.Token = token + return &this +} + +// NewGetTokenResponseWithDefaults instantiates a new GetTokenResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetTokenResponseWithDefaults() *GetTokenResponse { + this := GetTokenResponse{} + return &this +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *GetTokenResponse) GetMessage() *string { + if o == nil || IsNil(o.Message) { + var ret *string + return ret + } + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetTokenResponse) GetMessageOk() (*string, bool) { + if o == nil || IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *GetTokenResponse) HasMessage() bool { + if o != nil && !IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *GetTokenResponse) SetMessage(v *string) { + o.Message = v +} + +// GetToken returns the Token field value +func (o *GetTokenResponse) GetToken() *Token { + if o == nil || IsNil(o.Token) { + var ret *Token + return ret + } + + return o.Token +} + +// GetTokenOk returns a tuple with the Token field value +// and a boolean to check if the value has been set. +func (o *GetTokenResponse) GetTokenOk() (*Token, bool) { + if o == nil { + return nil, false + } + return o.Token, true +} + +// SetToken sets field value +func (o *GetTokenResponse) SetToken(v *Token) { + o.Token = v +} + +func (o GetTokenResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Message) { + toSerialize["message"] = o.Message + } + toSerialize["token"] = o.Token + return toSerialize, nil +} + +type NullableGetTokenResponse struct { + value *GetTokenResponse + isSet bool +} + +func (v NullableGetTokenResponse) Get() *GetTokenResponse { + return v.value +} + +func (v *NullableGetTokenResponse) Set(val *GetTokenResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetTokenResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetTokenResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetTokenResponse(val *GetTokenResponse) *NullableGetTokenResponse { + return &NullableGetTokenResponse{value: val, isSet: true} +} + +func (v NullableGetTokenResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetTokenResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/modelserving/model_list_models_response.go b/services/modelserving/model_list_models_response.go new file mode 100644 index 000000000..2558bce45 --- /dev/null +++ b/services/modelserving/model_list_models_response.go @@ -0,0 +1,146 @@ +/* +STACKIT Model Serving API + +This API provides endpoints for the model serving api + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package modelserving + +import ( + "encoding/json" +) + +// checks if the ListModelsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListModelsResponse{} + +// ListModelsResponse struct for ListModelsResponse +type ListModelsResponse struct { + Message *string `json:"message,omitempty"` + // REQUIRED + Models *[]Model `json:"models"` +} + +type _ListModelsResponse ListModelsResponse + +// NewListModelsResponse instantiates a new ListModelsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListModelsResponse(models *[]Model) *ListModelsResponse { + this := ListModelsResponse{} + this.Models = models + return &this +} + +// NewListModelsResponseWithDefaults instantiates a new ListModelsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListModelsResponseWithDefaults() *ListModelsResponse { + this := ListModelsResponse{} + return &this +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *ListModelsResponse) GetMessage() *string { + if o == nil || IsNil(o.Message) { + var ret *string + return ret + } + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListModelsResponse) GetMessageOk() (*string, bool) { + if o == nil || IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *ListModelsResponse) HasMessage() bool { + if o != nil && !IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *ListModelsResponse) SetMessage(v *string) { + o.Message = v +} + +// GetModels returns the Models field value +func (o *ListModelsResponse) GetModels() *[]Model { + if o == nil || IsNil(o.Models) { + var ret *[]Model + return ret + } + + return o.Models +} + +// GetModelsOk returns a tuple with the Models field value +// and a boolean to check if the value has been set. +func (o *ListModelsResponse) GetModelsOk() (*[]Model, bool) { + if o == nil { + return nil, false + } + return o.Models, true +} + +// SetModels sets field value +func (o *ListModelsResponse) SetModels(v *[]Model) { + o.Models = v +} + +func (o ListModelsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Message) { + toSerialize["message"] = o.Message + } + toSerialize["models"] = o.Models + return toSerialize, nil +} + +type NullableListModelsResponse struct { + value *ListModelsResponse + isSet bool +} + +func (v NullableListModelsResponse) Get() *ListModelsResponse { + return v.value +} + +func (v *NullableListModelsResponse) Set(val *ListModelsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListModelsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListModelsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListModelsResponse(val *ListModelsResponse) *NullableListModelsResponse { + return &NullableListModelsResponse{value: val, isSet: true} +} + +func (v NullableListModelsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListModelsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/modelserving/model_list_token_resp.go b/services/modelserving/model_list_token_resp.go new file mode 100644 index 000000000..611c83f39 --- /dev/null +++ b/services/modelserving/model_list_token_resp.go @@ -0,0 +1,146 @@ +/* +STACKIT Model Serving API + +This API provides endpoints for the model serving api + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package modelserving + +import ( + "encoding/json" +) + +// checks if the ListTokenResp type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListTokenResp{} + +// ListTokenResp struct for ListTokenResp +type ListTokenResp struct { + Message *string `json:"message,omitempty"` + // REQUIRED + Tokens *[]Token `json:"tokens"` +} + +type _ListTokenResp ListTokenResp + +// NewListTokenResp instantiates a new ListTokenResp object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListTokenResp(tokens *[]Token) *ListTokenResp { + this := ListTokenResp{} + this.Tokens = tokens + return &this +} + +// NewListTokenRespWithDefaults instantiates a new ListTokenResp object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListTokenRespWithDefaults() *ListTokenResp { + this := ListTokenResp{} + return &this +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *ListTokenResp) GetMessage() *string { + if o == nil || IsNil(o.Message) { + var ret *string + return ret + } + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListTokenResp) GetMessageOk() (*string, bool) { + if o == nil || IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *ListTokenResp) HasMessage() bool { + if o != nil && !IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *ListTokenResp) SetMessage(v *string) { + o.Message = v +} + +// GetTokens returns the Tokens field value +func (o *ListTokenResp) GetTokens() *[]Token { + if o == nil || IsNil(o.Tokens) { + var ret *[]Token + return ret + } + + return o.Tokens +} + +// GetTokensOk returns a tuple with the Tokens field value +// and a boolean to check if the value has been set. +func (o *ListTokenResp) GetTokensOk() (*[]Token, bool) { + if o == nil { + return nil, false + } + return o.Tokens, true +} + +// SetTokens sets field value +func (o *ListTokenResp) SetTokens(v *[]Token) { + o.Tokens = v +} + +func (o ListTokenResp) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Message) { + toSerialize["message"] = o.Message + } + toSerialize["tokens"] = o.Tokens + return toSerialize, nil +} + +type NullableListTokenResp struct { + value *ListTokenResp + isSet bool +} + +func (v NullableListTokenResp) Get() *ListTokenResp { + return v.value +} + +func (v *NullableListTokenResp) Set(val *ListTokenResp) { + v.value = val + v.isSet = true +} + +func (v NullableListTokenResp) IsSet() bool { + return v.isSet +} + +func (v *NullableListTokenResp) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListTokenResp(val *ListTokenResp) *NullableListTokenResp { + return &NullableListTokenResp{value: val, isSet: true} +} + +func (v NullableListTokenResp) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListTokenResp) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/modelserving/model_message_response.go b/services/modelserving/model_message_response.go new file mode 100644 index 000000000..d2c99fe0b --- /dev/null +++ b/services/modelserving/model_message_response.go @@ -0,0 +1,116 @@ +/* +STACKIT Model Serving API + +This API provides endpoints for the model serving api + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package modelserving + +import ( + "encoding/json" +) + +// checks if the MessageResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MessageResponse{} + +// MessageResponse struct for MessageResponse +type MessageResponse struct { + Message *string `json:"message,omitempty"` +} + +// NewMessageResponse instantiates a new MessageResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMessageResponse() *MessageResponse { + this := MessageResponse{} + return &this +} + +// NewMessageResponseWithDefaults instantiates a new MessageResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMessageResponseWithDefaults() *MessageResponse { + this := MessageResponse{} + return &this +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *MessageResponse) GetMessage() *string { + if o == nil || IsNil(o.Message) { + var ret *string + return ret + } + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MessageResponse) GetMessageOk() (*string, bool) { + if o == nil || IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *MessageResponse) HasMessage() bool { + if o != nil && !IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *MessageResponse) SetMessage(v *string) { + o.Message = v +} + +func (o MessageResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Message) { + toSerialize["message"] = o.Message + } + return toSerialize, nil +} + +type NullableMessageResponse struct { + value *MessageResponse + isSet bool +} + +func (v NullableMessageResponse) Get() *MessageResponse { + return v.value +} + +func (v *NullableMessageResponse) Set(val *MessageResponse) { + v.value = val + v.isSet = true +} + +func (v NullableMessageResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableMessageResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMessageResponse(val *MessageResponse) *NullableMessageResponse { + return &NullableMessageResponse{value: val, isSet: true} +} + +func (v NullableMessageResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMessageResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/modelserving/model_model.go b/services/modelserving/model_model.go new file mode 100644 index 000000000..c551ae321 --- /dev/null +++ b/services/modelserving/model_model.go @@ -0,0 +1,373 @@ +/* +STACKIT Model Serving API + +This API provides endpoints for the model serving api + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package modelserving + +import ( + "encoding/json" +) + +// checks if the Model type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Model{} + +// Model struct for Model +type Model struct { + // REQUIRED + Category *string `json:"category"` + // REQUIRED + Description *string `json:"description"` + // REQUIRED + DisplayedName *string `json:"displayedName"` + // generated uuid to identify a model + // REQUIRED + Id *string `json:"id"` + // huggingface name + // REQUIRED + Name *string `json:"name"` + // REQUIRED + Region *string `json:"region"` + // REQUIRED + Skus *[]SKU `json:"skus"` + Tags *[]string `json:"tags,omitempty"` + // REQUIRED + Type *string `json:"type"` + // url of the model + // REQUIRED + Url *string `json:"url"` +} + +type _Model Model + +// NewModel instantiates a new Model object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewModel(category *string, description *string, displayedName *string, id *string, name *string, region *string, skus *[]SKU, type_ *string, url *string) *Model { + this := Model{} + this.Category = category + this.Description = description + this.DisplayedName = displayedName + this.Id = id + this.Name = name + this.Region = region + this.Skus = skus + this.Type = type_ + this.Url = url + return &this +} + +// NewModelWithDefaults instantiates a new Model object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewModelWithDefaults() *Model { + this := Model{} + return &this +} + +// GetCategory returns the Category field value +func (o *Model) GetCategory() *string { + if o == nil || IsNil(o.Category) { + var ret *string + return ret + } + + return o.Category +} + +// GetCategoryOk returns a tuple with the Category field value +// and a boolean to check if the value has been set. +func (o *Model) GetCategoryOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Category, true +} + +// SetCategory sets field value +func (o *Model) SetCategory(v *string) { + o.Category = v +} + +// GetDescription returns the Description field value +func (o *Model) GetDescription() *string { + if o == nil || IsNil(o.Description) { + var ret *string + return ret + } + + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *Model) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Description, true +} + +// SetDescription sets field value +func (o *Model) SetDescription(v *string) { + o.Description = v +} + +// GetDisplayedName returns the DisplayedName field value +func (o *Model) GetDisplayedName() *string { + if o == nil || IsNil(o.DisplayedName) { + var ret *string + return ret + } + + return o.DisplayedName +} + +// GetDisplayedNameOk returns a tuple with the DisplayedName field value +// and a boolean to check if the value has been set. +func (o *Model) GetDisplayedNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.DisplayedName, true +} + +// SetDisplayedName sets field value +func (o *Model) SetDisplayedName(v *string) { + o.DisplayedName = v +} + +// GetId returns the Id field value +func (o *Model) GetId() *string { + if o == nil || IsNil(o.Id) { + var ret *string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Model) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Id, true +} + +// SetId sets field value +func (o *Model) SetId(v *string) { + o.Id = v +} + +// GetName returns the Name field value +func (o *Model) GetName() *string { + if o == nil || IsNil(o.Name) { + var ret *string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Model) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Name, true +} + +// SetName sets field value +func (o *Model) SetName(v *string) { + o.Name = v +} + +// GetRegion returns the Region field value +func (o *Model) GetRegion() *string { + if o == nil || IsNil(o.Region) { + var ret *string + return ret + } + + return o.Region +} + +// GetRegionOk returns a tuple with the Region field value +// and a boolean to check if the value has been set. +func (o *Model) GetRegionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Region, true +} + +// SetRegion sets field value +func (o *Model) SetRegion(v *string) { + o.Region = v +} + +// GetSkus returns the Skus field value +func (o *Model) GetSkus() *[]SKU { + if o == nil || IsNil(o.Skus) { + var ret *[]SKU + return ret + } + + return o.Skus +} + +// GetSkusOk returns a tuple with the Skus field value +// and a boolean to check if the value has been set. +func (o *Model) GetSkusOk() (*[]SKU, bool) { + if o == nil { + return nil, false + } + return o.Skus, true +} + +// SetSkus sets field value +func (o *Model) SetSkus(v *[]SKU) { + o.Skus = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *Model) GetTags() *[]string { + if o == nil || IsNil(o.Tags) { + var ret *[]string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Model) GetTagsOk() (*[]string, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *Model) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *Model) SetTags(v *[]string) { + o.Tags = v +} + +// GetType returns the Type field value +func (o *Model) GetType() *string { + if o == nil || IsNil(o.Type) { + var ret *string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Model) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Type, true +} + +// SetType sets field value +func (o *Model) SetType(v *string) { + o.Type = v +} + +// GetUrl returns the Url field value +func (o *Model) GetUrl() *string { + if o == nil || IsNil(o.Url) { + var ret *string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *Model) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Url, true +} + +// SetUrl sets field value +func (o *Model) SetUrl(v *string) { + o.Url = v +} + +func (o Model) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["category"] = o.Category + toSerialize["description"] = o.Description + toSerialize["displayedName"] = o.DisplayedName + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + toSerialize["region"] = o.Region + toSerialize["skus"] = o.Skus + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + toSerialize["type"] = o.Type + toSerialize["url"] = o.Url + return toSerialize, nil +} + +type NullableModel struct { + value *Model + isSet bool +} + +func (v NullableModel) Get() *Model { + return v.value +} + +func (v *NullableModel) Set(val *Model) { + v.value = val + v.isSet = true +} + +func (v NullableModel) IsSet() bool { + return v.isSet +} + +func (v *NullableModel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableModel(val *Model) *NullableModel { + return &NullableModel{value: val, isSet: true} +} + +func (v NullableModel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableModel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/modelserving/model_partial_update_token_payload.go b/services/modelserving/model_partial_update_token_payload.go new file mode 100644 index 000000000..2c3f31756 --- /dev/null +++ b/services/modelserving/model_partial_update_token_payload.go @@ -0,0 +1,152 @@ +/* +STACKIT Model Serving API + +This API provides endpoints for the model serving api + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package modelserving + +import ( + "encoding/json" +) + +// checks if the PartialUpdateTokenPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PartialUpdateTokenPayload{} + +// PartialUpdateTokenPayload struct for PartialUpdateTokenPayload +type PartialUpdateTokenPayload struct { + Description *string `json:"description,omitempty"` + Name *string `json:"name,omitempty"` +} + +// NewPartialUpdateTokenPayload instantiates a new PartialUpdateTokenPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPartialUpdateTokenPayload() *PartialUpdateTokenPayload { + this := PartialUpdateTokenPayload{} + return &this +} + +// NewPartialUpdateTokenPayloadWithDefaults instantiates a new PartialUpdateTokenPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPartialUpdateTokenPayloadWithDefaults() *PartialUpdateTokenPayload { + this := PartialUpdateTokenPayload{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PartialUpdateTokenPayload) GetDescription() *string { + if o == nil || IsNil(o.Description) { + var ret *string + return ret + } + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateTokenPayload) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PartialUpdateTokenPayload) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PartialUpdateTokenPayload) SetDescription(v *string) { + o.Description = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PartialUpdateTokenPayload) GetName() *string { + if o == nil || IsNil(o.Name) { + var ret *string + return ret + } + return o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateTokenPayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PartialUpdateTokenPayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PartialUpdateTokenPayload) SetName(v *string) { + o.Name = v +} + +func (o PartialUpdateTokenPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + return toSerialize, nil +} + +type NullablePartialUpdateTokenPayload struct { + value *PartialUpdateTokenPayload + isSet bool +} + +func (v NullablePartialUpdateTokenPayload) Get() *PartialUpdateTokenPayload { + return v.value +} + +func (v *NullablePartialUpdateTokenPayload) Set(val *PartialUpdateTokenPayload) { + v.value = val + v.isSet = true +} + +func (v NullablePartialUpdateTokenPayload) IsSet() bool { + return v.isSet +} + +func (v *NullablePartialUpdateTokenPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartialUpdateTokenPayload(val *PartialUpdateTokenPayload) *NullablePartialUpdateTokenPayload { + return &NullablePartialUpdateTokenPayload{value: val, isSet: true} +} + +func (v NullablePartialUpdateTokenPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartialUpdateTokenPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/modelserving/model_sku.go b/services/modelserving/model_sku.go new file mode 100644 index 000000000..9cfeac9c4 --- /dev/null +++ b/services/modelserving/model_sku.go @@ -0,0 +1,182 @@ +/* +STACKIT Model Serving API + +This API provides endpoints for the model serving api + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package modelserving + +import ( + "encoding/json" +) + +// checks if the SKU type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SKU{} + +// SKU struct for SKU +type SKU struct { + Description *string `json:"description,omitempty"` + // REQUIRED + Id *string `json:"id"` + Type *string `json:"type,omitempty"` +} + +type _SKU SKU + +// NewSKU instantiates a new SKU object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSKU(id *string) *SKU { + this := SKU{} + this.Id = id + return &this +} + +// NewSKUWithDefaults instantiates a new SKU object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSKUWithDefaults() *SKU { + this := SKU{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *SKU) GetDescription() *string { + if o == nil || IsNil(o.Description) { + var ret *string + return ret + } + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SKU) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *SKU) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *SKU) SetDescription(v *string) { + o.Description = v +} + +// GetId returns the Id field value +func (o *SKU) GetId() *string { + if o == nil || IsNil(o.Id) { + var ret *string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *SKU) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Id, true +} + +// SetId sets field value +func (o *SKU) SetId(v *string) { + o.Id = v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *SKU) GetType() *string { + if o == nil || IsNil(o.Type) { + var ret *string + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SKU) GetTypeOk() (*string, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *SKU) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *SKU) SetType(v *string) { + o.Type = v +} + +func (o SKU) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["id"] = o.Id + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + return toSerialize, nil +} + +type NullableSKU struct { + value *SKU + isSet bool +} + +func (v NullableSKU) Get() *SKU { + return v.value +} + +func (v *NullableSKU) Set(val *SKU) { + v.value = val + v.isSet = true +} + +func (v NullableSKU) IsSet() bool { + return v.isSet +} + +func (v *NullableSKU) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSKU(val *SKU) *NullableSKU { + return &NullableSKU{value: val, isSet: true} +} + +func (v NullableSKU) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSKU) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/modelserving/model_token.go b/services/modelserving/model_token.go new file mode 100644 index 000000000..cdfb13b3e --- /dev/null +++ b/services/modelserving/model_token.go @@ -0,0 +1,259 @@ +/* +STACKIT Model Serving API + +This API provides endpoints for the model serving api + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package modelserving + +import ( + "encoding/json" + "time" +) + +// checks if the Token type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Token{} + +// Token struct for Token +type Token struct { + Description *string `json:"description,omitempty"` + // REQUIRED + Id *string `json:"id"` + // REQUIRED + Name *string `json:"name"` + // REQUIRED + Region *string `json:"region"` + // REQUIRED + State *string `json:"state"` + // REQUIRED + ValidUntil *time.Time `json:"validUntil"` +} + +type _Token Token + +// NewToken instantiates a new Token object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewToken(id *string, name *string, region *string, state *string, validUntil *time.Time) *Token { + this := Token{} + this.Id = id + this.Name = name + this.Region = region + this.State = state + this.ValidUntil = validUntil + return &this +} + +// NewTokenWithDefaults instantiates a new Token object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTokenWithDefaults() *Token { + this := Token{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *Token) GetDescription() *string { + if o == nil || IsNil(o.Description) { + var ret *string + return ret + } + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Token) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *Token) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *Token) SetDescription(v *string) { + o.Description = v +} + +// GetId returns the Id field value +func (o *Token) GetId() *string { + if o == nil || IsNil(o.Id) { + var ret *string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Token) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Id, true +} + +// SetId sets field value +func (o *Token) SetId(v *string) { + o.Id = v +} + +// GetName returns the Name field value +func (o *Token) GetName() *string { + if o == nil || IsNil(o.Name) { + var ret *string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Token) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Name, true +} + +// SetName sets field value +func (o *Token) SetName(v *string) { + o.Name = v +} + +// GetRegion returns the Region field value +func (o *Token) GetRegion() *string { + if o == nil || IsNil(o.Region) { + var ret *string + return ret + } + + return o.Region +} + +// GetRegionOk returns a tuple with the Region field value +// and a boolean to check if the value has been set. +func (o *Token) GetRegionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Region, true +} + +// SetRegion sets field value +func (o *Token) SetRegion(v *string) { + o.Region = v +} + +// GetState returns the State field value +func (o *Token) GetState() *string { + if o == nil || IsNil(o.State) { + var ret *string + return ret + } + + return o.State +} + +// GetStateOk returns a tuple with the State field value +// and a boolean to check if the value has been set. +func (o *Token) GetStateOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.State, true +} + +// SetState sets field value +func (o *Token) SetState(v *string) { + o.State = v +} + +// GetValidUntil returns the ValidUntil field value +func (o *Token) GetValidUntil() *time.Time { + if o == nil || IsNil(o.ValidUntil) { + var ret *time.Time + return ret + } + + return o.ValidUntil +} + +// GetValidUntilOk returns a tuple with the ValidUntil field value +// and a boolean to check if the value has been set. +func (o *Token) GetValidUntilOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.ValidUntil, true +} + +// SetValidUntil sets field value +func (o *Token) SetValidUntil(v *time.Time) { + o.ValidUntil = v +} + +func (o Token) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + toSerialize["region"] = o.Region + toSerialize["state"] = o.State + toSerialize["validUntil"] = o.ValidUntil + return toSerialize, nil +} + +type NullableToken struct { + value *Token + isSet bool +} + +func (v NullableToken) Get() *Token { + return v.value +} + +func (v *NullableToken) Set(val *Token) { + v.value = val + v.isSet = true +} + +func (v NullableToken) IsSet() bool { + return v.isSet +} + +func (v *NullableToken) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableToken(val *Token) *NullableToken { + return &NullableToken{value: val, isSet: true} +} + +func (v NullableToken) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableToken) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/modelserving/model_token_created.go b/services/modelserving/model_token_created.go new file mode 100644 index 000000000..27862d224 --- /dev/null +++ b/services/modelserving/model_token_created.go @@ -0,0 +1,287 @@ +/* +STACKIT Model Serving API + +This API provides endpoints for the model serving api + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package modelserving + +import ( + "encoding/json" + "time" +) + +// checks if the TokenCreated type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TokenCreated{} + +// TokenCreated struct for TokenCreated +type TokenCreated struct { + // REQUIRED + Content *string `json:"content"` + Description *string `json:"description,omitempty"` + // REQUIRED + Id *string `json:"id"` + // REQUIRED + Name *string `json:"name"` + // REQUIRED + Region *string `json:"region"` + // REQUIRED + State *string `json:"state"` + // REQUIRED + ValidUntil *time.Time `json:"validUntil"` +} + +type _TokenCreated TokenCreated + +// NewTokenCreated instantiates a new TokenCreated object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTokenCreated(content *string, id *string, name *string, region *string, state *string, validUntil *time.Time) *TokenCreated { + this := TokenCreated{} + this.Content = content + this.Id = id + this.Name = name + this.Region = region + this.State = state + this.ValidUntil = validUntil + return &this +} + +// NewTokenCreatedWithDefaults instantiates a new TokenCreated object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTokenCreatedWithDefaults() *TokenCreated { + this := TokenCreated{} + return &this +} + +// GetContent returns the Content field value +func (o *TokenCreated) GetContent() *string { + if o == nil || IsNil(o.Content) { + var ret *string + return ret + } + + return o.Content +} + +// GetContentOk returns a tuple with the Content field value +// and a boolean to check if the value has been set. +func (o *TokenCreated) GetContentOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Content, true +} + +// SetContent sets field value +func (o *TokenCreated) SetContent(v *string) { + o.Content = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *TokenCreated) GetDescription() *string { + if o == nil || IsNil(o.Description) { + var ret *string + return ret + } + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TokenCreated) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *TokenCreated) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *TokenCreated) SetDescription(v *string) { + o.Description = v +} + +// GetId returns the Id field value +func (o *TokenCreated) GetId() *string { + if o == nil || IsNil(o.Id) { + var ret *string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *TokenCreated) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Id, true +} + +// SetId sets field value +func (o *TokenCreated) SetId(v *string) { + o.Id = v +} + +// GetName returns the Name field value +func (o *TokenCreated) GetName() *string { + if o == nil || IsNil(o.Name) { + var ret *string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *TokenCreated) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Name, true +} + +// SetName sets field value +func (o *TokenCreated) SetName(v *string) { + o.Name = v +} + +// GetRegion returns the Region field value +func (o *TokenCreated) GetRegion() *string { + if o == nil || IsNil(o.Region) { + var ret *string + return ret + } + + return o.Region +} + +// GetRegionOk returns a tuple with the Region field value +// and a boolean to check if the value has been set. +func (o *TokenCreated) GetRegionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Region, true +} + +// SetRegion sets field value +func (o *TokenCreated) SetRegion(v *string) { + o.Region = v +} + +// GetState returns the State field value +func (o *TokenCreated) GetState() *string { + if o == nil || IsNil(o.State) { + var ret *string + return ret + } + + return o.State +} + +// GetStateOk returns a tuple with the State field value +// and a boolean to check if the value has been set. +func (o *TokenCreated) GetStateOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.State, true +} + +// SetState sets field value +func (o *TokenCreated) SetState(v *string) { + o.State = v +} + +// GetValidUntil returns the ValidUntil field value +func (o *TokenCreated) GetValidUntil() *time.Time { + if o == nil || IsNil(o.ValidUntil) { + var ret *time.Time + return ret + } + + return o.ValidUntil +} + +// GetValidUntilOk returns a tuple with the ValidUntil field value +// and a boolean to check if the value has been set. +func (o *TokenCreated) GetValidUntilOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.ValidUntil, true +} + +// SetValidUntil sets field value +func (o *TokenCreated) SetValidUntil(v *time.Time) { + o.ValidUntil = v +} + +func (o TokenCreated) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["content"] = o.Content + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + toSerialize["region"] = o.Region + toSerialize["state"] = o.State + toSerialize["validUntil"] = o.ValidUntil + return toSerialize, nil +} + +type NullableTokenCreated struct { + value *TokenCreated + isSet bool +} + +func (v NullableTokenCreated) Get() *TokenCreated { + return v.value +} + +func (v *NullableTokenCreated) Set(val *TokenCreated) { + v.value = val + v.isSet = true +} + +func (v NullableTokenCreated) IsSet() bool { + return v.isSet +} + +func (v *NullableTokenCreated) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTokenCreated(val *TokenCreated) *NullableTokenCreated { + return &NullableTokenCreated{value: val, isSet: true} +} + +func (v NullableTokenCreated) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTokenCreated) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/modelserving/model_update_token_response.go b/services/modelserving/model_update_token_response.go new file mode 100644 index 000000000..332ccfa9b --- /dev/null +++ b/services/modelserving/model_update_token_response.go @@ -0,0 +1,146 @@ +/* +STACKIT Model Serving API + +This API provides endpoints for the model serving api + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package modelserving + +import ( + "encoding/json" +) + +// checks if the UpdateTokenResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateTokenResponse{} + +// UpdateTokenResponse struct for UpdateTokenResponse +type UpdateTokenResponse struct { + Message *string `json:"message,omitempty"` + // REQUIRED + Token *Token `json:"token"` +} + +type _UpdateTokenResponse UpdateTokenResponse + +// NewUpdateTokenResponse instantiates a new UpdateTokenResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateTokenResponse(token *Token) *UpdateTokenResponse { + this := UpdateTokenResponse{} + this.Token = token + return &this +} + +// NewUpdateTokenResponseWithDefaults instantiates a new UpdateTokenResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateTokenResponseWithDefaults() *UpdateTokenResponse { + this := UpdateTokenResponse{} + return &this +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *UpdateTokenResponse) GetMessage() *string { + if o == nil || IsNil(o.Message) { + var ret *string + return ret + } + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateTokenResponse) GetMessageOk() (*string, bool) { + if o == nil || IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *UpdateTokenResponse) HasMessage() bool { + if o != nil && !IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *UpdateTokenResponse) SetMessage(v *string) { + o.Message = v +} + +// GetToken returns the Token field value +func (o *UpdateTokenResponse) GetToken() *Token { + if o == nil || IsNil(o.Token) { + var ret *Token + return ret + } + + return o.Token +} + +// GetTokenOk returns a tuple with the Token field value +// and a boolean to check if the value has been set. +func (o *UpdateTokenResponse) GetTokenOk() (*Token, bool) { + if o == nil { + return nil, false + } + return o.Token, true +} + +// SetToken sets field value +func (o *UpdateTokenResponse) SetToken(v *Token) { + o.Token = v +} + +func (o UpdateTokenResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Message) { + toSerialize["message"] = o.Message + } + toSerialize["token"] = o.Token + return toSerialize, nil +} + +type NullableUpdateTokenResponse struct { + value *UpdateTokenResponse + isSet bool +} + +func (v NullableUpdateTokenResponse) Get() *UpdateTokenResponse { + return v.value +} + +func (v *NullableUpdateTokenResponse) Set(val *UpdateTokenResponse) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateTokenResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateTokenResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateTokenResponse(val *UpdateTokenResponse) *NullableUpdateTokenResponse { + return &NullableUpdateTokenResponse{value: val, isSet: true} +} + +func (v NullableUpdateTokenResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateTokenResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/modelserving/utils.go b/services/modelserving/utils.go new file mode 100644 index 000000000..c50d22838 --- /dev/null +++ b/services/modelserving/utils.go @@ -0,0 +1,347 @@ +/* +STACKIT Model Serving API + +This API provides endpoints for the model serving api + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package modelserving + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} From 8252ae4f49f0cd77d4d4346b882f95a8dcb57e99 Mon Sep 17 00:00:00 2001 From: Marcel Jacek Date: Tue, 25 Feb 2025 17:57:38 +0100 Subject: [PATCH 2/2] Update CHANGELOG - Add LICENSE, CHANGELOG and NOTICE --- CHANGELOG.md | 2 + services/modelserving/CHANGELOG.md | 3 + services/modelserving/LICENSE.md | 201 +++++++++++++++++++++++++++++ services/modelserving/NOTICE.txt | 2 + 4 files changed, 208 insertions(+) create mode 100644 services/modelserving/CHANGELOG.md create mode 100644 services/modelserving/LICENSE.md create mode 100644 services/modelserving/NOTICE.txt diff --git a/CHANGELOG.md b/CHANGELOG.md index 139d65108..29c6fd370 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ - `sqlserverflex`: [v1.0.0](services/sqlserverflex/CHANGELOG.md#v100-2025-02-25) - **Breaking Change:** The region is no longer specified within the client configuration. Instead, the region must be passed as a parameter to any region-specific request. - **Feature:** Add method to delete all instances for a project: `TerminateProject` +- `modelserving`: [v0.1.0](services/modelserving/CHANGELOG.md#v010-2025-02-25) + - **New**: STACKIT Model Serving module can be used to manage the STACKIT Model Serving. ## Release (2025-02-21) > [!WARNING] diff --git a/services/modelserving/CHANGELOG.md b/services/modelserving/CHANGELOG.md new file mode 100644 index 000000000..867b8760c --- /dev/null +++ b/services/modelserving/CHANGELOG.md @@ -0,0 +1,3 @@ +## v0.1.0 (2025-02-25) + +- **New**: STACKIT Model Serving module can be used to manage the STACKIT Model Serving. diff --git a/services/modelserving/LICENSE.md b/services/modelserving/LICENSE.md new file mode 100644 index 000000000..7e2f06484 --- /dev/null +++ b/services/modelserving/LICENSE.md @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright 2025 Schwarz IT KG + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/services/modelserving/NOTICE.txt b/services/modelserving/NOTICE.txt new file mode 100644 index 000000000..fdd6d45ae --- /dev/null +++ b/services/modelserving/NOTICE.txt @@ -0,0 +1,2 @@ +STACKIT Model Serving SDK for Go +Copyright 2025 Schwarz IT KG \ No newline at end of file