diff --git a/go.work b/go.work index ffdbac6b7..643812537 100644 --- a/go.work +++ b/go.work @@ -38,6 +38,7 @@ use ( ./services/git ./services/iaas ./services/iaasalpha + ./services/intake ./services/kms ./services/lbapplication ./services/loadbalancer diff --git a/services/intake/.openapi-generator/VERSION b/services/intake/.openapi-generator/VERSION new file mode 100644 index 000000000..cd802a1ec --- /dev/null +++ b/services/intake/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/services/intake/api_default.go b/services/intake/api_default.go new file mode 100644 index 000000000..566b7a356 --- /dev/null +++ b/services/intake/api_default.go @@ -0,0 +1,2467 @@ +/* +STACKIT Intake API + +This API provides endpoints for managing Intakes. + +API version: 1beta.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package intake + +import ( + "bytes" + "context" + "fmt" + "io" + "net/http" + "net/url" + "strings" + + "github.com/stackitcloud/stackit-sdk-go/core/config" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" +) + +type DefaultApi interface { + /* + CreateIntake Method for CreateIntake + Creates a new intake within the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT portal project UUID the resource is located in. + @param regionId The STACKIT region name the resource is located in. + @return ApiCreateIntakeRequest + */ + CreateIntake(ctx context.Context, projectId string, regionId string) ApiCreateIntakeRequest + /* + CreateIntakeExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT portal project UUID the resource is located in. + @param regionId The STACKIT region name the resource is located in. + @return IntakeResponse + + */ + CreateIntakeExecute(ctx context.Context, projectId string, regionId string) (*IntakeResponse, error) + /* + CreateIntakeRunner Method for CreateIntakeRunner + Creates a new intake runner within the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT portal project UUID the resource is located in. + @param regionId The STACKIT region name the resource is located in. + @return ApiCreateIntakeRunnerRequest + */ + CreateIntakeRunner(ctx context.Context, projectId string, regionId string) ApiCreateIntakeRunnerRequest + /* + CreateIntakeRunnerExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT portal project UUID the resource is located in. + @param regionId The STACKIT region name the resource is located in. + @return IntakeRunnerResponse + + */ + CreateIntakeRunnerExecute(ctx context.Context, projectId string, regionId string) (*IntakeRunnerResponse, error) + /* + CreateIntakeUser Method for CreateIntakeUser + Creates a new user for this intake. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT portal project UUID the resource is located in. + @param regionId The STACKIT region name the resource is located in. + @param intakeId The intake UUID. + @return ApiCreateIntakeUserRequest + */ + CreateIntakeUser(ctx context.Context, projectId string, regionId string, intakeId string) ApiCreateIntakeUserRequest + /* + CreateIntakeUserExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT portal project UUID the resource is located in. + @param regionId The STACKIT region name the resource is located in. + @param intakeId The intake UUID. + @return IntakeUserResponse + + */ + CreateIntakeUserExecute(ctx context.Context, projectId string, regionId string, intakeId string) (*IntakeUserResponse, error) + /* + DeleteIntake Method for DeleteIntake + Deletes the given intake. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT portal project UUID the resource is located in. + @param regionId The STACKIT region name the resource is located in. + @param intakeId The intake UUID. + @return ApiDeleteIntakeRequest + */ + DeleteIntake(ctx context.Context, projectId string, regionId string, intakeId string) ApiDeleteIntakeRequest + /* + DeleteIntakeExecute executes the request + + */ + DeleteIntakeExecute(ctx context.Context, projectId string, regionId string, intakeId string) error + /* + DeleteIntakeRunner Method for DeleteIntakeRunner + Deletes the given intake runner. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT portal project UUID the resource is located in. + @param regionId The STACKIT region name the resource is located in. + @param intakeRunnerId The intake runner UUID. + @return ApiDeleteIntakeRunnerRequest + */ + DeleteIntakeRunner(ctx context.Context, projectId string, regionId string, intakeRunnerId string) ApiDeleteIntakeRunnerRequest + /* + DeleteIntakeRunnerExecute executes the request + + */ + DeleteIntakeRunnerExecute(ctx context.Context, projectId string, regionId string, intakeRunnerId string) error + /* + DeleteIntakeUser Method for DeleteIntakeUser + Deletes the given intake user. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT portal project UUID the resource is located in. + @param regionId The STACKIT region name the resource is located in. + @param intakeId The intake UUID. + @param intakeUserId The intake user UUID. + @return ApiDeleteIntakeUserRequest + */ + DeleteIntakeUser(ctx context.Context, projectId string, regionId string, intakeId string, intakeUserId string) ApiDeleteIntakeUserRequest + /* + DeleteIntakeUserExecute executes the request + + */ + DeleteIntakeUserExecute(ctx context.Context, projectId string, regionId string, intakeId string, intakeUserId string) error + /* + GetIntake Method for GetIntake + Returns the details for the given intake. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT portal project UUID the resource is located in. + @param regionId The STACKIT region name the resource is located in. + @param intakeId The intake UUID. + @return ApiGetIntakeRequest + */ + GetIntake(ctx context.Context, projectId string, regionId string, intakeId string) ApiGetIntakeRequest + /* + GetIntakeExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT portal project UUID the resource is located in. + @param regionId The STACKIT region name the resource is located in. + @param intakeId The intake UUID. + @return IntakeResponse + + */ + GetIntakeExecute(ctx context.Context, projectId string, regionId string, intakeId string) (*IntakeResponse, error) + /* + GetIntakeRunner Method for GetIntakeRunner + Returns the details for the given intake runner. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT portal project UUID the resource is located in. + @param regionId The STACKIT region name the resource is located in. + @param intakeRunnerId The intake runner UUID. + @return ApiGetIntakeRunnerRequest + */ + GetIntakeRunner(ctx context.Context, projectId string, regionId string, intakeRunnerId string) ApiGetIntakeRunnerRequest + /* + GetIntakeRunnerExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT portal project UUID the resource is located in. + @param regionId The STACKIT region name the resource is located in. + @param intakeRunnerId The intake runner UUID. + @return IntakeRunnerResponse + + */ + GetIntakeRunnerExecute(ctx context.Context, projectId string, regionId string, intakeRunnerId string) (*IntakeRunnerResponse, error) + /* + GetIntakeUser Method for GetIntakeUser + Returns the details for the given user. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT portal project UUID the resource is located in. + @param regionId The STACKIT region name the resource is located in. + @param intakeId The intake UUID. + @param intakeUserId The intake user UUID. + @return ApiGetIntakeUserRequest + */ + GetIntakeUser(ctx context.Context, projectId string, regionId string, intakeId string, intakeUserId string) ApiGetIntakeUserRequest + /* + GetIntakeUserExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT portal project UUID the resource is located in. + @param regionId The STACKIT region name the resource is located in. + @param intakeId The intake UUID. + @param intakeUserId The intake user UUID. + @return IntakeUserResponse + + */ + GetIntakeUserExecute(ctx context.Context, projectId string, regionId string, intakeId string, intakeUserId string) (*IntakeUserResponse, error) + /* + ListIntakeRunners Method for ListIntakeRunners + Returns a list of all intake runners within the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT portal project UUID the resource is located in. + @param regionId The STACKIT region name the resource is located in. + @return ApiListIntakeRunnersRequest + */ + ListIntakeRunners(ctx context.Context, projectId string, regionId string) ApiListIntakeRunnersRequest + /* + ListIntakeRunnersExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT portal project UUID the resource is located in. + @param regionId The STACKIT region name the resource is located in. + @return ListIntakeRunnersResponse + + */ + ListIntakeRunnersExecute(ctx context.Context, projectId string, regionId string) (*ListIntakeRunnersResponse, error) + /* + ListIntakeUsers Method for ListIntakeUsers + Returns a list of all intake users within the project and intake. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT portal project UUID the resource is located in. + @param regionId The STACKIT region name the resource is located in. + @param intakeId The intake UUID. + @return ApiListIntakeUsersRequest + */ + ListIntakeUsers(ctx context.Context, projectId string, regionId string, intakeId string) ApiListIntakeUsersRequest + /* + ListIntakeUsersExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT portal project UUID the resource is located in. + @param regionId The STACKIT region name the resource is located in. + @param intakeId The intake UUID. + @return ListIntakeUsersResponse + + */ + ListIntakeUsersExecute(ctx context.Context, projectId string, regionId string, intakeId string) (*ListIntakeUsersResponse, error) + /* + ListIntakes Method for ListIntakes + Returns a list of all intakes within the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT portal project UUID the resource is located in. + @param regionId The STACKIT region name the resource is located in. + @return ApiListIntakesRequest + */ + ListIntakes(ctx context.Context, projectId string, regionId string) ApiListIntakesRequest + /* + ListIntakesExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT portal project UUID the resource is located in. + @param regionId The STACKIT region name the resource is located in. + @return ListIntakesResponse + + */ + ListIntakesExecute(ctx context.Context, projectId string, regionId string) (*ListIntakesResponse, error) + /* + UpdateIntake Method for UpdateIntake + Updates the given intake. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT portal project UUID the resource is located in. + @param regionId The STACKIT region name the resource is located in. + @param intakeId The intake UUID. + @return ApiUpdateIntakeRequest + */ + UpdateIntake(ctx context.Context, projectId string, regionId string, intakeId string) ApiUpdateIntakeRequest + /* + UpdateIntakeExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT portal project UUID the resource is located in. + @param regionId The STACKIT region name the resource is located in. + @param intakeId The intake UUID. + @return IntakeResponse + + */ + UpdateIntakeExecute(ctx context.Context, projectId string, regionId string, intakeId string) (*IntakeResponse, error) + /* + UpdateIntakeRunner Method for UpdateIntakeRunner + Updates a intake runner within the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT portal project UUID the resource is located in. + @param regionId The STACKIT region name the resource is located in. + @param intakeRunnerId The intake runner UUID. + @return ApiUpdateIntakeRunnerRequest + */ + UpdateIntakeRunner(ctx context.Context, projectId string, regionId string, intakeRunnerId string) ApiUpdateIntakeRunnerRequest + /* + UpdateIntakeRunnerExecute executes the request + + */ + UpdateIntakeRunnerExecute(ctx context.Context, projectId string, regionId string, intakeRunnerId string) error + /* + UpdateIntakeUser Method for UpdateIntakeUser + Updates the given intake user. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT portal project UUID the resource is located in. + @param regionId The STACKIT region name the resource is located in. + @param intakeId The intake UUID. + @param intakeUserId The intake user UUID. + @return ApiUpdateIntakeUserRequest + */ + UpdateIntakeUser(ctx context.Context, projectId string, regionId string, intakeId string, intakeUserId string) ApiUpdateIntakeUserRequest + /* + UpdateIntakeUserExecute executes the request + + */ + UpdateIntakeUserExecute(ctx context.Context, projectId string, regionId string, intakeId string, intakeUserId string) error +} + +type ApiCreateIntakeRequest interface { + CreateIntakePayload(createIntakePayload CreateIntakePayload) ApiCreateIntakeRequest + Execute() (*IntakeResponse, error) +} + +type ApiCreateIntakeRunnerRequest interface { + CreateIntakeRunnerPayload(createIntakeRunnerPayload CreateIntakeRunnerPayload) ApiCreateIntakeRunnerRequest + Execute() (*IntakeRunnerResponse, error) +} + +type ApiCreateIntakeUserRequest interface { + CreateIntakeUserPayload(createIntakeUserPayload CreateIntakeUserPayload) ApiCreateIntakeUserRequest + Execute() (*IntakeUserResponse, error) +} + +type ApiDeleteIntakeRequest interface { + // If true, deletes all child resources. If false, the resource remains in a 'deletion state' while child resources exist. + Force(force bool) ApiDeleteIntakeRequest + Execute() error +} + +type ApiDeleteIntakeRunnerRequest interface { + // If true, deletes all child resources. If false, the resource remains in a 'deletion state' while child resources exist. + Force(force bool) ApiDeleteIntakeRunnerRequest + Execute() error +} + +type ApiDeleteIntakeUserRequest interface { + Execute() error +} + +type ApiGetIntakeRequest interface { + Execute() (*IntakeResponse, error) +} + +type ApiGetIntakeRunnerRequest interface { + Execute() (*IntakeRunnerResponse, error) +} + +type ApiGetIntakeUserRequest interface { + Execute() (*IntakeUserResponse, error) +} + +type ApiListIntakeRunnersRequest interface { + // A token to retrieve the next page of results. + PageToken(pageToken string) ApiListIntakeRunnersRequest + // Maximum number of items to return + PageSize(pageSize int32) ApiListIntakeRunnersRequest + Execute() (*ListIntakeRunnersResponse, error) +} + +type ApiListIntakeUsersRequest interface { + // A token to retrieve the next page of results. + PageToken(pageToken string) ApiListIntakeUsersRequest + // Maximum number of items to return + PageSize(pageSize int32) ApiListIntakeUsersRequest + Execute() (*ListIntakeUsersResponse, error) +} + +type ApiListIntakesRequest interface { + // A token to retrieve the next page of results. + PageToken(pageToken string) ApiListIntakesRequest + // Maximum number of items to return + PageSize(pageSize int32) ApiListIntakesRequest + Execute() (*ListIntakesResponse, error) +} + +type ApiUpdateIntakeRequest interface { + UpdateIntakePayload(updateIntakePayload UpdateIntakePayload) ApiUpdateIntakeRequest + Execute() (*IntakeResponse, error) +} + +type ApiUpdateIntakeRunnerRequest interface { + UpdateIntakeRunnerPayload(updateIntakeRunnerPayload UpdateIntakeRunnerPayload) ApiUpdateIntakeRunnerRequest + Execute() error +} + +type ApiUpdateIntakeUserRequest interface { + UpdateIntakeUserPayload(updateIntakeUserPayload UpdateIntakeUserPayload) ApiUpdateIntakeUserRequest + Execute() error +} + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type CreateIntakeRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + regionId string + createIntakePayload *CreateIntakePayload +} + +func (r CreateIntakeRequest) CreateIntakePayload(createIntakePayload CreateIntakePayload) ApiCreateIntakeRequest { + r.createIntakePayload = &createIntakePayload + return r +} + +func (r CreateIntakeRequest) Execute() (*IntakeResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *IntakeResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateIntake") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{regionId}/intakes" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createIntakePayload == nil { + return localVarReturnValue, fmt.Errorf("createIntakePayload is required and must be specified") + } + + // 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.createIntakePayload + req, err := 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 := 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, + } + return localVarReturnValue, newErr + } + + err = 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 +} + +/* +CreateIntake: Method for CreateIntake + +Creates a new intake within the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT portal project UUID the resource is located in. + @param regionId The STACKIT region name the resource is located in. + @return ApiCreateIntakeRequest +*/ +func (a *APIClient) CreateIntake(ctx context.Context, projectId string, regionId string) ApiCreateIntakeRequest { + return CreateIntakeRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + regionId: regionId, + } +} + +func (a *APIClient) CreateIntakeExecute(ctx context.Context, projectId string, regionId string) (*IntakeResponse, error) { + r := CreateIntakeRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + regionId: regionId, + } + return r.Execute() +} + +type CreateIntakeRunnerRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + regionId string + createIntakeRunnerPayload *CreateIntakeRunnerPayload +} + +func (r CreateIntakeRunnerRequest) CreateIntakeRunnerPayload(createIntakeRunnerPayload CreateIntakeRunnerPayload) ApiCreateIntakeRunnerRequest { + r.createIntakeRunnerPayload = &createIntakeRunnerPayload + return r +} + +func (r CreateIntakeRunnerRequest) Execute() (*IntakeRunnerResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *IntakeRunnerResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateIntakeRunner") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{regionId}/intake-runners" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createIntakeRunnerPayload == nil { + return localVarReturnValue, fmt.Errorf("createIntakeRunnerPayload is required and must be specified") + } + + // 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.createIntakeRunnerPayload + req, err := 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 := 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, + } + return localVarReturnValue, newErr + } + + err = 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 +} + +/* +CreateIntakeRunner: Method for CreateIntakeRunner + +Creates a new intake runner within the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT portal project UUID the resource is located in. + @param regionId The STACKIT region name the resource is located in. + @return ApiCreateIntakeRunnerRequest +*/ +func (a *APIClient) CreateIntakeRunner(ctx context.Context, projectId string, regionId string) ApiCreateIntakeRunnerRequest { + return CreateIntakeRunnerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + regionId: regionId, + } +} + +func (a *APIClient) CreateIntakeRunnerExecute(ctx context.Context, projectId string, regionId string) (*IntakeRunnerResponse, error) { + r := CreateIntakeRunnerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + regionId: regionId, + } + return r.Execute() +} + +type CreateIntakeUserRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + regionId string + intakeId string + createIntakeUserPayload *CreateIntakeUserPayload +} + +func (r CreateIntakeUserRequest) CreateIntakeUserPayload(createIntakeUserPayload CreateIntakeUserPayload) ApiCreateIntakeUserRequest { + r.createIntakeUserPayload = &createIntakeUserPayload + return r +} + +func (r CreateIntakeUserRequest) Execute() (*IntakeUserResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *IntakeUserResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateIntakeUser") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{regionId}/intakes/{intakeId}/users" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"intakeId"+"}", url.PathEscape(ParameterValueToString(r.intakeId, "intakeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createIntakeUserPayload == nil { + return localVarReturnValue, fmt.Errorf("createIntakeUserPayload is required and must be specified") + } + + // 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.createIntakeUserPayload + req, err := 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 := 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, + } + return localVarReturnValue, newErr + } + + err = 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 +} + +/* +CreateIntakeUser: Method for CreateIntakeUser + +Creates a new user for this intake. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT portal project UUID the resource is located in. + @param regionId The STACKIT region name the resource is located in. + @param intakeId The intake UUID. + @return ApiCreateIntakeUserRequest +*/ +func (a *APIClient) CreateIntakeUser(ctx context.Context, projectId string, regionId string, intakeId string) ApiCreateIntakeUserRequest { + return CreateIntakeUserRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + regionId: regionId, + intakeId: intakeId, + } +} + +func (a *APIClient) CreateIntakeUserExecute(ctx context.Context, projectId string, regionId string, intakeId string) (*IntakeUserResponse, error) { + r := CreateIntakeUserRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + regionId: regionId, + intakeId: intakeId, + } + return r.Execute() +} + +type DeleteIntakeRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + regionId string + intakeId string + force *bool +} + +// If true, deletes all child resources. If false, the resource remains in a 'deletion state' while child resources exist. + +func (r DeleteIntakeRequest) Force(force bool) ApiDeleteIntakeRequest { + r.force = &force + return r +} + +func (r DeleteIntakeRequest) Execute() error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteIntake") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{regionId}/intakes/{intakeId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"intakeId"+"}", url.PathEscape(ParameterValueToString(r.intakeId, "intakeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.force != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "force", r.force, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + return newErr + } + + return nil +} + +/* +DeleteIntake: Method for DeleteIntake + +Deletes the given intake. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT portal project UUID the resource is located in. + @param regionId The STACKIT region name the resource is located in. + @param intakeId The intake UUID. + @return ApiDeleteIntakeRequest +*/ +func (a *APIClient) DeleteIntake(ctx context.Context, projectId string, regionId string, intakeId string) ApiDeleteIntakeRequest { + return DeleteIntakeRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + regionId: regionId, + intakeId: intakeId, + } +} + +func (a *APIClient) DeleteIntakeExecute(ctx context.Context, projectId string, regionId string, intakeId string) error { + r := DeleteIntakeRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + regionId: regionId, + intakeId: intakeId, + } + return r.Execute() +} + +type DeleteIntakeRunnerRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + regionId string + intakeRunnerId string + force *bool +} + +// If true, deletes all child resources. If false, the resource remains in a 'deletion state' while child resources exist. + +func (r DeleteIntakeRunnerRequest) Force(force bool) ApiDeleteIntakeRunnerRequest { + r.force = &force + return r +} + +func (r DeleteIntakeRunnerRequest) Execute() error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteIntakeRunner") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{regionId}/intake-runners/{intakeRunnerId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"intakeRunnerId"+"}", url.PathEscape(ParameterValueToString(r.intakeRunnerId, "intakeRunnerId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.force != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "force", r.force, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + return newErr + } + + return nil +} + +/* +DeleteIntakeRunner: Method for DeleteIntakeRunner + +Deletes the given intake runner. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT portal project UUID the resource is located in. + @param regionId The STACKIT region name the resource is located in. + @param intakeRunnerId The intake runner UUID. + @return ApiDeleteIntakeRunnerRequest +*/ +func (a *APIClient) DeleteIntakeRunner(ctx context.Context, projectId string, regionId string, intakeRunnerId string) ApiDeleteIntakeRunnerRequest { + return DeleteIntakeRunnerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + regionId: regionId, + intakeRunnerId: intakeRunnerId, + } +} + +func (a *APIClient) DeleteIntakeRunnerExecute(ctx context.Context, projectId string, regionId string, intakeRunnerId string) error { + r := DeleteIntakeRunnerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + regionId: regionId, + intakeRunnerId: intakeRunnerId, + } + return r.Execute() +} + +type DeleteIntakeUserRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + regionId string + intakeId string + intakeUserId string +} + +func (r DeleteIntakeUserRequest) Execute() error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteIntakeUser") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{regionId}/intakes/{intakeId}/users/{intakeUserId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"intakeId"+"}", url.PathEscape(ParameterValueToString(r.intakeId, "intakeId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"intakeUserId"+"}", url.PathEscape(ParameterValueToString(r.intakeUserId, "intakeUserId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + return newErr + } + + return nil +} + +/* +DeleteIntakeUser: Method for DeleteIntakeUser + +Deletes the given intake user. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT portal project UUID the resource is located in. + @param regionId The STACKIT region name the resource is located in. + @param intakeId The intake UUID. + @param intakeUserId The intake user UUID. + @return ApiDeleteIntakeUserRequest +*/ +func (a *APIClient) DeleteIntakeUser(ctx context.Context, projectId string, regionId string, intakeId string, intakeUserId string) ApiDeleteIntakeUserRequest { + return DeleteIntakeUserRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + regionId: regionId, + intakeId: intakeId, + intakeUserId: intakeUserId, + } +} + +func (a *APIClient) DeleteIntakeUserExecute(ctx context.Context, projectId string, regionId string, intakeId string, intakeUserId string) error { + r := DeleteIntakeUserRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + regionId: regionId, + intakeId: intakeId, + intakeUserId: intakeUserId, + } + return r.Execute() +} + +type GetIntakeRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + regionId string + intakeId string +} + +func (r GetIntakeRequest) Execute() (*IntakeResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *IntakeResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetIntake") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{regionId}/intakes/{intakeId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"intakeId"+"}", url.PathEscape(ParameterValueToString(r.intakeId, "intakeId")), -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 := 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 := 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, + } + return localVarReturnValue, newErr + } + + err = 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 +} + +/* +GetIntake: Method for GetIntake + +Returns the details for the given intake. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT portal project UUID the resource is located in. + @param regionId The STACKIT region name the resource is located in. + @param intakeId The intake UUID. + @return ApiGetIntakeRequest +*/ +func (a *APIClient) GetIntake(ctx context.Context, projectId string, regionId string, intakeId string) ApiGetIntakeRequest { + return GetIntakeRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + regionId: regionId, + intakeId: intakeId, + } +} + +func (a *APIClient) GetIntakeExecute(ctx context.Context, projectId string, regionId string, intakeId string) (*IntakeResponse, error) { + r := GetIntakeRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + regionId: regionId, + intakeId: intakeId, + } + return r.Execute() +} + +type GetIntakeRunnerRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + regionId string + intakeRunnerId string +} + +func (r GetIntakeRunnerRequest) Execute() (*IntakeRunnerResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *IntakeRunnerResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetIntakeRunner") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{regionId}/intake-runners/{intakeRunnerId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"intakeRunnerId"+"}", url.PathEscape(ParameterValueToString(r.intakeRunnerId, "intakeRunnerId")), -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 := 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 := 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, + } + return localVarReturnValue, newErr + } + + err = 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 +} + +/* +GetIntakeRunner: Method for GetIntakeRunner + +Returns the details for the given intake runner. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT portal project UUID the resource is located in. + @param regionId The STACKIT region name the resource is located in. + @param intakeRunnerId The intake runner UUID. + @return ApiGetIntakeRunnerRequest +*/ +func (a *APIClient) GetIntakeRunner(ctx context.Context, projectId string, regionId string, intakeRunnerId string) ApiGetIntakeRunnerRequest { + return GetIntakeRunnerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + regionId: regionId, + intakeRunnerId: intakeRunnerId, + } +} + +func (a *APIClient) GetIntakeRunnerExecute(ctx context.Context, projectId string, regionId string, intakeRunnerId string) (*IntakeRunnerResponse, error) { + r := GetIntakeRunnerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + regionId: regionId, + intakeRunnerId: intakeRunnerId, + } + return r.Execute() +} + +type GetIntakeUserRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + regionId string + intakeId string + intakeUserId string +} + +func (r GetIntakeUserRequest) Execute() (*IntakeUserResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *IntakeUserResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetIntakeUser") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{regionId}/intakes/{intakeId}/users/{intakeUserId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"intakeId"+"}", url.PathEscape(ParameterValueToString(r.intakeId, "intakeId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"intakeUserId"+"}", url.PathEscape(ParameterValueToString(r.intakeUserId, "intakeUserId")), -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 := 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 := 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, + } + return localVarReturnValue, newErr + } + + err = 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 +} + +/* +GetIntakeUser: Method for GetIntakeUser + +Returns the details for the given user. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT portal project UUID the resource is located in. + @param regionId The STACKIT region name the resource is located in. + @param intakeId The intake UUID. + @param intakeUserId The intake user UUID. + @return ApiGetIntakeUserRequest +*/ +func (a *APIClient) GetIntakeUser(ctx context.Context, projectId string, regionId string, intakeId string, intakeUserId string) ApiGetIntakeUserRequest { + return GetIntakeUserRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + regionId: regionId, + intakeId: intakeId, + intakeUserId: intakeUserId, + } +} + +func (a *APIClient) GetIntakeUserExecute(ctx context.Context, projectId string, regionId string, intakeId string, intakeUserId string) (*IntakeUserResponse, error) { + r := GetIntakeUserRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + regionId: regionId, + intakeId: intakeId, + intakeUserId: intakeUserId, + } + return r.Execute() +} + +type ListIntakeRunnersRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + regionId string + pageToken *string + pageSize *int32 +} + +// A token to retrieve the next page of results. + +func (r ListIntakeRunnersRequest) PageToken(pageToken string) ApiListIntakeRunnersRequest { + r.pageToken = &pageToken + return r +} + +// Maximum number of items to return + +func (r ListIntakeRunnersRequest) PageSize(pageSize int32) ApiListIntakeRunnersRequest { + r.pageSize = &pageSize + return r +} + +func (r ListIntakeRunnersRequest) Execute() (*ListIntakeRunnersResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListIntakeRunnersResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListIntakeRunners") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{regionId}/intake-runners" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.pageToken != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pageToken", r.pageToken, "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pageSize", r.pageSize, "") + } + // 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 := 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 := 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, + } + return localVarReturnValue, newErr + } + + err = 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 +} + +/* +ListIntakeRunners: Method for ListIntakeRunners + +Returns a list of all intake runners within the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT portal project UUID the resource is located in. + @param regionId The STACKIT region name the resource is located in. + @return ApiListIntakeRunnersRequest +*/ +func (a *APIClient) ListIntakeRunners(ctx context.Context, projectId string, regionId string) ApiListIntakeRunnersRequest { + return ListIntakeRunnersRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + regionId: regionId, + } +} + +func (a *APIClient) ListIntakeRunnersExecute(ctx context.Context, projectId string, regionId string) (*ListIntakeRunnersResponse, error) { + r := ListIntakeRunnersRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + regionId: regionId, + } + return r.Execute() +} + +type ListIntakeUsersRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + regionId string + intakeId string + pageToken *string + pageSize *int32 +} + +// A token to retrieve the next page of results. + +func (r ListIntakeUsersRequest) PageToken(pageToken string) ApiListIntakeUsersRequest { + r.pageToken = &pageToken + return r +} + +// Maximum number of items to return + +func (r ListIntakeUsersRequest) PageSize(pageSize int32) ApiListIntakeUsersRequest { + r.pageSize = &pageSize + return r +} + +func (r ListIntakeUsersRequest) Execute() (*ListIntakeUsersResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListIntakeUsersResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListIntakeUsers") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{regionId}/intakes/{intakeId}/users" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"intakeId"+"}", url.PathEscape(ParameterValueToString(r.intakeId, "intakeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.pageToken != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pageToken", r.pageToken, "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pageSize", r.pageSize, "") + } + // 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 := 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 := 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, + } + return localVarReturnValue, newErr + } + + err = 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 +} + +/* +ListIntakeUsers: Method for ListIntakeUsers + +Returns a list of all intake users within the project and intake. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT portal project UUID the resource is located in. + @param regionId The STACKIT region name the resource is located in. + @param intakeId The intake UUID. + @return ApiListIntakeUsersRequest +*/ +func (a *APIClient) ListIntakeUsers(ctx context.Context, projectId string, regionId string, intakeId string) ApiListIntakeUsersRequest { + return ListIntakeUsersRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + regionId: regionId, + intakeId: intakeId, + } +} + +func (a *APIClient) ListIntakeUsersExecute(ctx context.Context, projectId string, regionId string, intakeId string) (*ListIntakeUsersResponse, error) { + r := ListIntakeUsersRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + regionId: regionId, + intakeId: intakeId, + } + return r.Execute() +} + +type ListIntakesRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + regionId string + pageToken *string + pageSize *int32 +} + +// A token to retrieve the next page of results. + +func (r ListIntakesRequest) PageToken(pageToken string) ApiListIntakesRequest { + r.pageToken = &pageToken + return r +} + +// Maximum number of items to return + +func (r ListIntakesRequest) PageSize(pageSize int32) ApiListIntakesRequest { + r.pageSize = &pageSize + return r +} + +func (r ListIntakesRequest) Execute() (*ListIntakesResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListIntakesResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListIntakes") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{regionId}/intakes" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.pageToken != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pageToken", r.pageToken, "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pageSize", r.pageSize, "") + } + // 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 := 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 := 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, + } + return localVarReturnValue, newErr + } + + err = 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 +} + +/* +ListIntakes: Method for ListIntakes + +Returns a list of all intakes within the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT portal project UUID the resource is located in. + @param regionId The STACKIT region name the resource is located in. + @return ApiListIntakesRequest +*/ +func (a *APIClient) ListIntakes(ctx context.Context, projectId string, regionId string) ApiListIntakesRequest { + return ListIntakesRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + regionId: regionId, + } +} + +func (a *APIClient) ListIntakesExecute(ctx context.Context, projectId string, regionId string) (*ListIntakesResponse, error) { + r := ListIntakesRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + regionId: regionId, + } + return r.Execute() +} + +type UpdateIntakeRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + regionId string + intakeId string + updateIntakePayload *UpdateIntakePayload +} + +func (r UpdateIntakeRequest) UpdateIntakePayload(updateIntakePayload UpdateIntakePayload) ApiUpdateIntakeRequest { + r.updateIntakePayload = &updateIntakePayload + return r +} + +func (r UpdateIntakeRequest) Execute() (*IntakeResponse, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *IntakeResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateIntake") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{regionId}/intakes/{intakeId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"intakeId"+"}", url.PathEscape(ParameterValueToString(r.intakeId, "intakeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateIntakePayload == nil { + return localVarReturnValue, fmt.Errorf("updateIntakePayload is required and must be specified") + } + + // 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.updateIntakePayload + req, err := 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 := 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, + } + return localVarReturnValue, newErr + } + + err = 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 +} + +/* +UpdateIntake: Method for UpdateIntake + +Updates the given intake. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT portal project UUID the resource is located in. + @param regionId The STACKIT region name the resource is located in. + @param intakeId The intake UUID. + @return ApiUpdateIntakeRequest +*/ +func (a *APIClient) UpdateIntake(ctx context.Context, projectId string, regionId string, intakeId string) ApiUpdateIntakeRequest { + return UpdateIntakeRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + regionId: regionId, + intakeId: intakeId, + } +} + +func (a *APIClient) UpdateIntakeExecute(ctx context.Context, projectId string, regionId string, intakeId string) (*IntakeResponse, error) { + r := UpdateIntakeRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + regionId: regionId, + intakeId: intakeId, + } + return r.Execute() +} + +type UpdateIntakeRunnerRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + regionId string + intakeRunnerId string + updateIntakeRunnerPayload *UpdateIntakeRunnerPayload +} + +func (r UpdateIntakeRunnerRequest) UpdateIntakeRunnerPayload(updateIntakeRunnerPayload UpdateIntakeRunnerPayload) ApiUpdateIntakeRunnerRequest { + r.updateIntakeRunnerPayload = &updateIntakeRunnerPayload + return r +} + +func (r UpdateIntakeRunnerRequest) Execute() error { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateIntakeRunner") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{regionId}/intake-runners/{intakeRunnerId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"intakeRunnerId"+"}", url.PathEscape(ParameterValueToString(r.intakeRunnerId, "intakeRunnerId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateIntakeRunnerPayload == nil { + return fmt.Errorf("updateIntakeRunnerPayload is required and must be specified") + } + + // 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{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateIntakeRunnerPayload + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + return newErr + } + + return nil +} + +/* +UpdateIntakeRunner: Method for UpdateIntakeRunner + +Updates a intake runner within the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT portal project UUID the resource is located in. + @param regionId The STACKIT region name the resource is located in. + @param intakeRunnerId The intake runner UUID. + @return ApiUpdateIntakeRunnerRequest +*/ +func (a *APIClient) UpdateIntakeRunner(ctx context.Context, projectId string, regionId string, intakeRunnerId string) ApiUpdateIntakeRunnerRequest { + return UpdateIntakeRunnerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + regionId: regionId, + intakeRunnerId: intakeRunnerId, + } +} + +func (a *APIClient) UpdateIntakeRunnerExecute(ctx context.Context, projectId string, regionId string, intakeRunnerId string) error { + r := UpdateIntakeRunnerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + regionId: regionId, + intakeRunnerId: intakeRunnerId, + } + return r.Execute() +} + +type UpdateIntakeUserRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + regionId string + intakeId string + intakeUserId string + updateIntakeUserPayload *UpdateIntakeUserPayload +} + +func (r UpdateIntakeUserRequest) UpdateIntakeUserPayload(updateIntakeUserPayload UpdateIntakeUserPayload) ApiUpdateIntakeUserRequest { + r.updateIntakeUserPayload = &updateIntakeUserPayload + return r +} + +func (r UpdateIntakeUserRequest) Execute() error { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateIntakeUser") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{regionId}/intakes/{intakeId}/users/{intakeUserId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"intakeId"+"}", url.PathEscape(ParameterValueToString(r.intakeId, "intakeId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"intakeUserId"+"}", url.PathEscape(ParameterValueToString(r.intakeUserId, "intakeUserId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateIntakeUserPayload == nil { + return fmt.Errorf("updateIntakeUserPayload is required and must be specified") + } + + // 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{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateIntakeUserPayload + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + return newErr + } + + return nil +} + +/* +UpdateIntakeUser: Method for UpdateIntakeUser + +Updates the given intake user. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT portal project UUID the resource is located in. + @param regionId The STACKIT region name the resource is located in. + @param intakeId The intake UUID. + @param intakeUserId The intake user UUID. + @return ApiUpdateIntakeUserRequest +*/ +func (a *APIClient) UpdateIntakeUser(ctx context.Context, projectId string, regionId string, intakeId string, intakeUserId string) ApiUpdateIntakeUserRequest { + return UpdateIntakeUserRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + regionId: regionId, + intakeId: intakeId, + intakeUserId: intakeUserId, + } +} + +func (a *APIClient) UpdateIntakeUserExecute(ctx context.Context, projectId string, regionId string, intakeId string, intakeUserId string) error { + r := UpdateIntakeUserRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + regionId: regionId, + intakeId: intakeId, + intakeUserId: intakeUserId, + } + return r.Execute() +} diff --git a/services/intake/api_default_test.go b/services/intake/api_default_test.go new file mode 100644 index 000000000..e42014f86 --- /dev/null +++ b/services/intake/api_default_test.go @@ -0,0 +1,870 @@ +/* +STACKIT Intake API + +Testing DefaultApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package intake + +import ( + "context" + "encoding/json" + "net/http" + "net/http/httptest" + "net/url" + "strings" + "testing" + + "github.com/google/uuid" + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +func Test_intake_DefaultApiService(t *testing.T) { + + t.Run("Test DefaultApiService CreateIntake", func(t *testing.T) { + _apiUrlPath := "/v1beta/projects/{projectId}/regions/{regionId}/intakes" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionIdValue := "regionId-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(regionIdValue, "regionId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { + data := IntakeResponse{} + 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 intake_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) + } + + projectId := projectIdValue + regionId := regionIdValue + createIntakePayload := CreateIntakePayload{} + + resp, reqErr := apiClient.CreateIntake(context.Background(), projectId, regionId).CreateIntakePayload(createIntakePayload).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if IsNil(resp) { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService CreateIntakeRunner", func(t *testing.T) { + _apiUrlPath := "/v1beta/projects/{projectId}/regions/{regionId}/intake-runners" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionIdValue := "regionId-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(regionIdValue, "regionId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { + data := IntakeRunnerResponse{} + 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 intake_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) + } + + projectId := projectIdValue + regionId := regionIdValue + createIntakeRunnerPayload := CreateIntakeRunnerPayload{} + + resp, reqErr := apiClient.CreateIntakeRunner(context.Background(), projectId, regionId).CreateIntakeRunnerPayload(createIntakeRunnerPayload).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if IsNil(resp) { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService CreateIntakeUser", func(t *testing.T) { + _apiUrlPath := "/v1beta/projects/{projectId}/regions/{regionId}/intakes/{intakeId}/users" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionIdValue := "regionId-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(regionIdValue, "regionId")), -1) + intakeIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"intakeId"+"}", url.PathEscape(ParameterValueToString(intakeIdValue, "intakeId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { + data := IntakeUserResponse{} + 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 intake_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) + } + + projectId := projectIdValue + regionId := regionIdValue + intakeId := intakeIdValue + createIntakeUserPayload := CreateIntakeUserPayload{} + + resp, reqErr := apiClient.CreateIntakeUser(context.Background(), projectId, regionId, intakeId).CreateIntakeUserPayload(createIntakeUserPayload).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if IsNil(resp) { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService DeleteIntake", func(t *testing.T) { + _apiUrlPath := "/v1beta/projects/{projectId}/regions/{regionId}/intakes/{intakeId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionIdValue := "regionId-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(regionIdValue, "regionId")), -1) + intakeIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"intakeId"+"}", url.PathEscape(ParameterValueToString(intakeIdValue, "intakeId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { + }) + 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 intake_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) + } + + projectId := projectIdValue + regionId := regionIdValue + intakeId := intakeIdValue + + reqErr := apiClient.DeleteIntake(context.Background(), projectId, regionId, intakeId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + }) + + t.Run("Test DefaultApiService DeleteIntakeRunner", func(t *testing.T) { + _apiUrlPath := "/v1beta/projects/{projectId}/regions/{regionId}/intake-runners/{intakeRunnerId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionIdValue := "regionId-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(regionIdValue, "regionId")), -1) + intakeRunnerIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"intakeRunnerId"+"}", url.PathEscape(ParameterValueToString(intakeRunnerIdValue, "intakeRunnerId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { + }) + 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 intake_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) + } + + projectId := projectIdValue + regionId := regionIdValue + intakeRunnerId := intakeRunnerIdValue + + reqErr := apiClient.DeleteIntakeRunner(context.Background(), projectId, regionId, intakeRunnerId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + }) + + t.Run("Test DefaultApiService DeleteIntakeUser", func(t *testing.T) { + _apiUrlPath := "/v1beta/projects/{projectId}/regions/{regionId}/intakes/{intakeId}/users/{intakeUserId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionIdValue := "regionId-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(regionIdValue, "regionId")), -1) + intakeIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"intakeId"+"}", url.PathEscape(ParameterValueToString(intakeIdValue, "intakeId")), -1) + intakeUserIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"intakeUserId"+"}", url.PathEscape(ParameterValueToString(intakeUserIdValue, "intakeUserId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { + }) + 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 intake_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) + } + + projectId := projectIdValue + regionId := regionIdValue + intakeId := intakeIdValue + intakeUserId := intakeUserIdValue + + reqErr := apiClient.DeleteIntakeUser(context.Background(), projectId, regionId, intakeId, intakeUserId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + }) + + t.Run("Test DefaultApiService GetIntake", func(t *testing.T) { + _apiUrlPath := "/v1beta/projects/{projectId}/regions/{regionId}/intakes/{intakeId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionIdValue := "regionId-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(regionIdValue, "regionId")), -1) + intakeIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"intakeId"+"}", url.PathEscape(ParameterValueToString(intakeIdValue, "intakeId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { + data := IntakeResponse{} + 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 intake_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) + } + + projectId := projectIdValue + regionId := regionIdValue + intakeId := intakeIdValue + + resp, reqErr := apiClient.GetIntake(context.Background(), projectId, regionId, intakeId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if IsNil(resp) { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService GetIntakeRunner", func(t *testing.T) { + _apiUrlPath := "/v1beta/projects/{projectId}/regions/{regionId}/intake-runners/{intakeRunnerId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionIdValue := "regionId-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(regionIdValue, "regionId")), -1) + intakeRunnerIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"intakeRunnerId"+"}", url.PathEscape(ParameterValueToString(intakeRunnerIdValue, "intakeRunnerId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { + data := IntakeRunnerResponse{} + 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 intake_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) + } + + projectId := projectIdValue + regionId := regionIdValue + intakeRunnerId := intakeRunnerIdValue + + resp, reqErr := apiClient.GetIntakeRunner(context.Background(), projectId, regionId, intakeRunnerId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if IsNil(resp) { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService GetIntakeUser", func(t *testing.T) { + _apiUrlPath := "/v1beta/projects/{projectId}/regions/{regionId}/intakes/{intakeId}/users/{intakeUserId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionIdValue := "regionId-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(regionIdValue, "regionId")), -1) + intakeIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"intakeId"+"}", url.PathEscape(ParameterValueToString(intakeIdValue, "intakeId")), -1) + intakeUserIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"intakeUserId"+"}", url.PathEscape(ParameterValueToString(intakeUserIdValue, "intakeUserId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { + data := IntakeUserResponse{} + 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 intake_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) + } + + projectId := projectIdValue + regionId := regionIdValue + intakeId := intakeIdValue + intakeUserId := intakeUserIdValue + + resp, reqErr := apiClient.GetIntakeUser(context.Background(), projectId, regionId, intakeId, intakeUserId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if IsNil(resp) { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService ListIntakeRunners", func(t *testing.T) { + _apiUrlPath := "/v1beta/projects/{projectId}/regions/{regionId}/intake-runners" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionIdValue := "regionId-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(regionIdValue, "regionId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { + data := ListIntakeRunnersResponse{} + 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 intake_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) + } + + projectId := projectIdValue + regionId := regionIdValue + + resp, reqErr := apiClient.ListIntakeRunners(context.Background(), projectId, regionId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if IsNil(resp) { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService ListIntakeUsers", func(t *testing.T) { + _apiUrlPath := "/v1beta/projects/{projectId}/regions/{regionId}/intakes/{intakeId}/users" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionIdValue := "regionId-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(regionIdValue, "regionId")), -1) + intakeIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"intakeId"+"}", url.PathEscape(ParameterValueToString(intakeIdValue, "intakeId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { + data := ListIntakeUsersResponse{} + 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 intake_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) + } + + projectId := projectIdValue + regionId := regionIdValue + intakeId := intakeIdValue + + resp, reqErr := apiClient.ListIntakeUsers(context.Background(), projectId, regionId, intakeId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if IsNil(resp) { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService ListIntakes", func(t *testing.T) { + _apiUrlPath := "/v1beta/projects/{projectId}/regions/{regionId}/intakes" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionIdValue := "regionId-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(regionIdValue, "regionId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { + data := ListIntakesResponse{} + 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 intake_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) + } + + projectId := projectIdValue + regionId := regionIdValue + + resp, reqErr := apiClient.ListIntakes(context.Background(), projectId, regionId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if IsNil(resp) { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService UpdateIntake", func(t *testing.T) { + _apiUrlPath := "/v1beta/projects/{projectId}/regions/{regionId}/intakes/{intakeId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionIdValue := "regionId-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(regionIdValue, "regionId")), -1) + intakeIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"intakeId"+"}", url.PathEscape(ParameterValueToString(intakeIdValue, "intakeId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { + data := IntakeResponse{} + 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 intake_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) + } + + projectId := projectIdValue + regionId := regionIdValue + intakeId := intakeIdValue + updateIntakePayload := UpdateIntakePayload{} + + resp, reqErr := apiClient.UpdateIntake(context.Background(), projectId, regionId, intakeId).UpdateIntakePayload(updateIntakePayload).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if IsNil(resp) { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService UpdateIntakeRunner", func(t *testing.T) { + _apiUrlPath := "/v1beta/projects/{projectId}/regions/{regionId}/intake-runners/{intakeRunnerId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionIdValue := "regionId-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(regionIdValue, "regionId")), -1) + intakeRunnerIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"intakeRunnerId"+"}", url.PathEscape(ParameterValueToString(intakeRunnerIdValue, "intakeRunnerId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { + }) + 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 intake_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) + } + + projectId := projectIdValue + regionId := regionIdValue + intakeRunnerId := intakeRunnerIdValue + updateIntakeRunnerPayload := UpdateIntakeRunnerPayload{} + + reqErr := apiClient.UpdateIntakeRunner(context.Background(), projectId, regionId, intakeRunnerId).UpdateIntakeRunnerPayload(updateIntakeRunnerPayload).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + }) + + t.Run("Test DefaultApiService UpdateIntakeUser", func(t *testing.T) { + _apiUrlPath := "/v1beta/projects/{projectId}/regions/{regionId}/intakes/{intakeId}/users/{intakeUserId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionIdValue := "regionId-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(regionIdValue, "regionId")), -1) + intakeIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"intakeId"+"}", url.PathEscape(ParameterValueToString(intakeIdValue, "intakeId")), -1) + intakeUserIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"intakeUserId"+"}", url.PathEscape(ParameterValueToString(intakeUserIdValue, "intakeUserId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { + }) + 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 intake_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) + } + + projectId := projectIdValue + regionId := regionIdValue + intakeId := intakeIdValue + intakeUserId := intakeUserIdValue + updateIntakeUserPayload := UpdateIntakeUserPayload{} + + reqErr := apiClient.UpdateIntakeUser(context.Background(), projectId, regionId, intakeId, intakeUserId).UpdateIntakeUserPayload(updateIntakeUserPayload).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + }) + +} diff --git a/services/intake/client.go b/services/intake/client.go new file mode 100644 index 000000000..69dc49d87 --- /dev/null +++ b/services/intake/client.go @@ -0,0 +1,631 @@ +/* +STACKIT Intake API + +This API provides endpoints for managing Intakes. + +API version: 1beta.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package intake + +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 Intake API API v1beta.2.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 DefaultApi +} + +// 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 !IsNil(postBody) { + 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/intake/configuration.go b/services/intake/configuration.go new file mode 100644 index 000000000..03b192572 --- /dev/null +++ b/services/intake/configuration.go @@ -0,0 +1,41 @@ +/* +STACKIT Intake API + +This API provides endpoints for managing Intakes. + +API version: 1beta.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package intake + +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: "stackit-sdk-go/intake", + Debug: false, + Servers: config.ServerConfigurations{ + { + URL: "https://intake.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/intake/go.mod b/services/intake/go.mod new file mode 100644 index 000000000..8f37873cb --- /dev/null +++ b/services/intake/go.mod @@ -0,0 +1,10 @@ +module github.com/stackitcloud/stackit-sdk-go/services/intake + +go 1.21 + +require ( + github.com/google/uuid v1.6.0 + github.com/stackitcloud/stackit-sdk-go/core v0.17.3 +) + +require github.com/golang-jwt/jwt/v5 v5.2.3 // indirect diff --git a/services/intake/go.sum b/services/intake/go.sum new file mode 100644 index 000000000..e9c36ffb7 --- /dev/null +++ b/services/intake/go.sum @@ -0,0 +1,8 @@ +github.com/golang-jwt/jwt/v5 v5.2.3 h1:kkGXqQOBSDDWRhWNXTFpqGSCMyh/PLnqUvMGJPDJDs0= +github.com/golang-jwt/jwt/v5 v5.2.3/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.17.3 h1:GsZGmRRc/3GJLmCUnsZswirr5wfLRrwavbnL/renOqg= +github.com/stackitcloud/stackit-sdk-go/core v0.17.3/go.mod h1:HBCXJGPgdRulplDzhrmwC+Dak9B/x0nzNtmOpu+1Ahg= diff --git a/services/intake/model_catalog_auth.go b/services/intake/model_catalog_auth.go new file mode 100644 index 000000000..f11bfa077 --- /dev/null +++ b/services/intake/model_catalog_auth.go @@ -0,0 +1,172 @@ +/* +STACKIT Intake API + +This API provides endpoints for managing Intakes. + +API version: 1beta.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package intake + +import ( + "encoding/json" +) + +// checks if the CatalogAuth type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CatalogAuth{} + +/* + types and functions for dremio +*/ + +// isModel +type CatalogAuthGetDremioAttributeType = *DremioAuth +type CatalogAuthGetDremioArgType = DremioAuth +type CatalogAuthGetDremioRetType = DremioAuth + +func getCatalogAuthGetDremioAttributeTypeOk(arg CatalogAuthGetDremioAttributeType) (ret CatalogAuthGetDremioRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCatalogAuthGetDremioAttributeType(arg *CatalogAuthGetDremioAttributeType, val CatalogAuthGetDremioRetType) { + *arg = &val +} + +/* + types and functions for type +*/ + +// isEnumRef +type CatalogAuthGetTypeAttributeType = *CatalogAuthType +type CatalogAuthGetTypeArgType = CatalogAuthType +type CatalogAuthGetTypeRetType = CatalogAuthType + +func getCatalogAuthGetTypeAttributeTypeOk(arg CatalogAuthGetTypeAttributeType) (ret CatalogAuthGetTypeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCatalogAuthGetTypeAttributeType(arg *CatalogAuthGetTypeAttributeType, val CatalogAuthGetTypeRetType) { + *arg = &val +} + +// CatalogAuth Configures authentication for the Iceberg catalog +type CatalogAuth struct { + Dremio CatalogAuthGetDremioAttributeType `json:"dremio,omitempty"` + // REQUIRED + Type CatalogAuthGetTypeAttributeType `json:"type" required:"true"` +} + +type _CatalogAuth CatalogAuth + +// NewCatalogAuth instantiates a new CatalogAuth 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 NewCatalogAuth(types CatalogAuthGetTypeArgType) *CatalogAuth { + this := CatalogAuth{} + setCatalogAuthGetTypeAttributeType(&this.Type, types) + return &this +} + +// NewCatalogAuthWithDefaults instantiates a new CatalogAuth 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 NewCatalogAuthWithDefaults() *CatalogAuth { + this := CatalogAuth{} + return &this +} + +// GetDremio returns the Dremio field value if set, zero value otherwise. +func (o *CatalogAuth) GetDremio() (res CatalogAuthGetDremioRetType) { + res, _ = o.GetDremioOk() + return +} + +// GetDremioOk returns a tuple with the Dremio field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CatalogAuth) GetDremioOk() (ret CatalogAuthGetDremioRetType, ok bool) { + return getCatalogAuthGetDremioAttributeTypeOk(o.Dremio) +} + +// HasDremio returns a boolean if a field has been set. +func (o *CatalogAuth) HasDremio() bool { + _, ok := o.GetDremioOk() + return ok +} + +// SetDremio gets a reference to the given DremioAuth and assigns it to the Dremio field. +func (o *CatalogAuth) SetDremio(v CatalogAuthGetDremioRetType) { + setCatalogAuthGetDremioAttributeType(&o.Dremio, v) +} + +// GetType returns the Type field value +func (o *CatalogAuth) GetType() (ret CatalogAuthGetTypeRetType) { + ret, _ = o.GetTypeOk() + return ret +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *CatalogAuth) GetTypeOk() (ret CatalogAuthGetTypeRetType, ok bool) { + return getCatalogAuthGetTypeAttributeTypeOk(o.Type) +} + +// SetType sets field value +func (o *CatalogAuth) SetType(v CatalogAuthGetTypeRetType) { + setCatalogAuthGetTypeAttributeType(&o.Type, v) +} + +func (o CatalogAuth) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getCatalogAuthGetDremioAttributeTypeOk(o.Dremio); ok { + toSerialize["Dremio"] = val + } + if val, ok := getCatalogAuthGetTypeAttributeTypeOk(o.Type); ok { + toSerialize["Type"] = val + } + return toSerialize, nil +} + +type NullableCatalogAuth struct { + value *CatalogAuth + isSet bool +} + +func (v NullableCatalogAuth) Get() *CatalogAuth { + return v.value +} + +func (v *NullableCatalogAuth) Set(val *CatalogAuth) { + v.value = val + v.isSet = true +} + +func (v NullableCatalogAuth) IsSet() bool { + return v.isSet +} + +func (v *NullableCatalogAuth) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCatalogAuth(val *CatalogAuth) *NullableCatalogAuth { + return &NullableCatalogAuth{value: val, isSet: true} +} + +func (v NullableCatalogAuth) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCatalogAuth) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/intake/model_catalog_auth_patch.go b/services/intake/model_catalog_auth_patch.go new file mode 100644 index 000000000..90ac6877b --- /dev/null +++ b/services/intake/model_catalog_auth_patch.go @@ -0,0 +1,174 @@ +/* +STACKIT Intake API + +This API provides endpoints for managing Intakes. + +API version: 1beta.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package intake + +import ( + "encoding/json" +) + +// checks if the CatalogAuthPatch type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CatalogAuthPatch{} + +/* + types and functions for dremio +*/ + +// isModel +type CatalogAuthPatchGetDremioAttributeType = *DremioAuthPatch +type CatalogAuthPatchGetDremioArgType = DremioAuthPatch +type CatalogAuthPatchGetDremioRetType = DremioAuthPatch + +func getCatalogAuthPatchGetDremioAttributeTypeOk(arg CatalogAuthPatchGetDremioAttributeType) (ret CatalogAuthPatchGetDremioRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCatalogAuthPatchGetDremioAttributeType(arg *CatalogAuthPatchGetDremioAttributeType, val CatalogAuthPatchGetDremioRetType) { + *arg = &val +} + +/* + types and functions for type +*/ + +// isEnumRef +type CatalogAuthPatchGetTypeAttributeType = *CatalogAuthType +type CatalogAuthPatchGetTypeArgType = CatalogAuthType +type CatalogAuthPatchGetTypeRetType = CatalogAuthType + +func getCatalogAuthPatchGetTypeAttributeTypeOk(arg CatalogAuthPatchGetTypeAttributeType) (ret CatalogAuthPatchGetTypeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCatalogAuthPatchGetTypeAttributeType(arg *CatalogAuthPatchGetTypeAttributeType, val CatalogAuthPatchGetTypeRetType) { + *arg = &val +} + +// CatalogAuthPatch Configures authentication for the Iceberg catalog +type CatalogAuthPatch struct { + Dremio CatalogAuthPatchGetDremioAttributeType `json:"dremio,omitempty"` + Type CatalogAuthPatchGetTypeAttributeType `json:"type,omitempty"` +} + +// NewCatalogAuthPatch instantiates a new CatalogAuthPatch 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 NewCatalogAuthPatch() *CatalogAuthPatch { + this := CatalogAuthPatch{} + return &this +} + +// NewCatalogAuthPatchWithDefaults instantiates a new CatalogAuthPatch 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 NewCatalogAuthPatchWithDefaults() *CatalogAuthPatch { + this := CatalogAuthPatch{} + return &this +} + +// GetDremio returns the Dremio field value if set, zero value otherwise. +func (o *CatalogAuthPatch) GetDremio() (res CatalogAuthPatchGetDremioRetType) { + res, _ = o.GetDremioOk() + return +} + +// GetDremioOk returns a tuple with the Dremio field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CatalogAuthPatch) GetDremioOk() (ret CatalogAuthPatchGetDremioRetType, ok bool) { + return getCatalogAuthPatchGetDremioAttributeTypeOk(o.Dremio) +} + +// HasDremio returns a boolean if a field has been set. +func (o *CatalogAuthPatch) HasDremio() bool { + _, ok := o.GetDremioOk() + return ok +} + +// SetDremio gets a reference to the given DremioAuthPatch and assigns it to the Dremio field. +func (o *CatalogAuthPatch) SetDremio(v CatalogAuthPatchGetDremioRetType) { + setCatalogAuthPatchGetDremioAttributeType(&o.Dremio, v) +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *CatalogAuthPatch) GetType() (res CatalogAuthPatchGetTypeRetType) { + res, _ = o.GetTypeOk() + return +} + +// 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 *CatalogAuthPatch) GetTypeOk() (ret CatalogAuthPatchGetTypeRetType, ok bool) { + return getCatalogAuthPatchGetTypeAttributeTypeOk(o.Type) +} + +// HasType returns a boolean if a field has been set. +func (o *CatalogAuthPatch) HasType() bool { + _, ok := o.GetTypeOk() + return ok +} + +// SetType gets a reference to the given CatalogAuthType and assigns it to the Type field. +func (o *CatalogAuthPatch) SetType(v CatalogAuthPatchGetTypeRetType) { + setCatalogAuthPatchGetTypeAttributeType(&o.Type, v) +} + +func (o CatalogAuthPatch) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getCatalogAuthPatchGetDremioAttributeTypeOk(o.Dremio); ok { + toSerialize["Dremio"] = val + } + if val, ok := getCatalogAuthPatchGetTypeAttributeTypeOk(o.Type); ok { + toSerialize["Type"] = val + } + return toSerialize, nil +} + +type NullableCatalogAuthPatch struct { + value *CatalogAuthPatch + isSet bool +} + +func (v NullableCatalogAuthPatch) Get() *CatalogAuthPatch { + return v.value +} + +func (v *NullableCatalogAuthPatch) Set(val *CatalogAuthPatch) { + v.value = val + v.isSet = true +} + +func (v NullableCatalogAuthPatch) IsSet() bool { + return v.isSet +} + +func (v *NullableCatalogAuthPatch) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCatalogAuthPatch(val *CatalogAuthPatch) *NullableCatalogAuthPatch { + return &NullableCatalogAuthPatch{value: val, isSet: true} +} + +func (v NullableCatalogAuthPatch) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCatalogAuthPatch) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/intake/model_catalog_auth_patch_test.go b/services/intake/model_catalog_auth_patch_test.go new file mode 100644 index 000000000..7a79462aa --- /dev/null +++ b/services/intake/model_catalog_auth_patch_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Intake API + +This API provides endpoints for managing Intakes. + +API version: 1beta.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package intake diff --git a/services/intake/model_catalog_auth_test.go b/services/intake/model_catalog_auth_test.go new file mode 100644 index 000000000..7a79462aa --- /dev/null +++ b/services/intake/model_catalog_auth_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Intake API + +This API provides endpoints for managing Intakes. + +API version: 1beta.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package intake diff --git a/services/intake/model_catalog_auth_type.go b/services/intake/model_catalog_auth_type.go new file mode 100644 index 000000000..123a26a5c --- /dev/null +++ b/services/intake/model_catalog_auth_type.go @@ -0,0 +1,115 @@ +/* +STACKIT Intake API + +This API provides endpoints for managing Intakes. + +API version: 1beta.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package intake + +import ( + "encoding/json" + "fmt" +) + +// CatalogAuthType Means of authentication for catalog requests +type CatalogAuthType string + +// List of catalogAuthType +const ( + CATALOGAUTHTYPE_NONE CatalogAuthType = "none" + CATALOGAUTHTYPE_DREMIO CatalogAuthType = "dremio" +) + +// All allowed values of CatalogAuthType enum +var AllowedCatalogAuthTypeEnumValues = []CatalogAuthType{ + "none", + "dremio", +} + +func (v *CatalogAuthType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + // Allow unmarshalling zero value for testing purposes + var zeroValue string + if value == zeroValue { + return nil + } + enumTypeValue := CatalogAuthType(value) + for _, existing := range AllowedCatalogAuthTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid CatalogAuthType", value) +} + +// NewCatalogAuthTypeFromValue returns a pointer to a valid CatalogAuthType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCatalogAuthTypeFromValue(v string) (*CatalogAuthType, error) { + ev := CatalogAuthType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CatalogAuthType: valid values are %v", v, AllowedCatalogAuthTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CatalogAuthType) IsValid() bool { + for _, existing := range AllowedCatalogAuthTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to catalogAuthType value +func (v CatalogAuthType) Ptr() *CatalogAuthType { + return &v +} + +type NullableCatalogAuthType struct { + value *CatalogAuthType + isSet bool +} + +func (v NullableCatalogAuthType) Get() *CatalogAuthType { + return v.value +} + +func (v *NullableCatalogAuthType) Set(val *CatalogAuthType) { + v.value = val + v.isSet = true +} + +func (v NullableCatalogAuthType) IsSet() bool { + return v.isSet +} + +func (v *NullableCatalogAuthType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCatalogAuthType(val *CatalogAuthType) *NullableCatalogAuthType { + return &NullableCatalogAuthType{value: val, isSet: true} +} + +func (v NullableCatalogAuthType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCatalogAuthType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/intake/model_catalog_auth_type_test.go b/services/intake/model_catalog_auth_type_test.go new file mode 100644 index 000000000..7a79462aa --- /dev/null +++ b/services/intake/model_catalog_auth_type_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Intake API + +This API provides endpoints for managing Intakes. + +API version: 1beta.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package intake diff --git a/services/intake/model_client_config.go b/services/intake/model_client_config.go new file mode 100644 index 000000000..ef90ecff2 --- /dev/null +++ b/services/intake/model_client_config.go @@ -0,0 +1,172 @@ +/* +STACKIT Intake API + +This API provides endpoints for managing Intakes. + +API version: 1beta.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package intake + +import ( + "encoding/json" +) + +// checks if the ClientConfig type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ClientConfig{} + +/* + types and functions for java +*/ + +// isNotNullableString +type ClientConfigGetJavaAttributeType = *string + +func getClientConfigGetJavaAttributeTypeOk(arg ClientConfigGetJavaAttributeType) (ret ClientConfigGetJavaRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setClientConfigGetJavaAttributeType(arg *ClientConfigGetJavaAttributeType, val ClientConfigGetJavaRetType) { + *arg = &val +} + +type ClientConfigGetJavaArgType = string +type ClientConfigGetJavaRetType = string + +/* + types and functions for librdkafka +*/ + +// isNotNullableString +type ClientConfigGetLibrdkafkaAttributeType = *string + +func getClientConfigGetLibrdkafkaAttributeTypeOk(arg ClientConfigGetLibrdkafkaAttributeType) (ret ClientConfigGetLibrdkafkaRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setClientConfigGetLibrdkafkaAttributeType(arg *ClientConfigGetLibrdkafkaAttributeType, val ClientConfigGetLibrdkafkaRetType) { + *arg = &val +} + +type ClientConfigGetLibrdkafkaArgType = string +type ClientConfigGetLibrdkafkaRetType = string + +// ClientConfig Configuration properties for supported clients. +type ClientConfig struct { + // Configuration for Java Kafka clients. + // REQUIRED + Java ClientConfigGetJavaAttributeType `json:"java" required:"true"` + // Configuration for Kafka clients using librdkafka + // REQUIRED + Librdkafka ClientConfigGetLibrdkafkaAttributeType `json:"librdkafka" required:"true"` +} + +type _ClientConfig ClientConfig + +// NewClientConfig instantiates a new ClientConfig 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 NewClientConfig(java ClientConfigGetJavaArgType, librdkafka ClientConfigGetLibrdkafkaArgType) *ClientConfig { + this := ClientConfig{} + setClientConfigGetJavaAttributeType(&this.Java, java) + setClientConfigGetLibrdkafkaAttributeType(&this.Librdkafka, librdkafka) + return &this +} + +// NewClientConfigWithDefaults instantiates a new ClientConfig 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 NewClientConfigWithDefaults() *ClientConfig { + this := ClientConfig{} + return &this +} + +// GetJava returns the Java field value +func (o *ClientConfig) GetJava() (ret ClientConfigGetJavaRetType) { + ret, _ = o.GetJavaOk() + return ret +} + +// GetJavaOk returns a tuple with the Java field value +// and a boolean to check if the value has been set. +func (o *ClientConfig) GetJavaOk() (ret ClientConfigGetJavaRetType, ok bool) { + return getClientConfigGetJavaAttributeTypeOk(o.Java) +} + +// SetJava sets field value +func (o *ClientConfig) SetJava(v ClientConfigGetJavaRetType) { + setClientConfigGetJavaAttributeType(&o.Java, v) +} + +// GetLibrdkafka returns the Librdkafka field value +func (o *ClientConfig) GetLibrdkafka() (ret ClientConfigGetLibrdkafkaRetType) { + ret, _ = o.GetLibrdkafkaOk() + return ret +} + +// GetLibrdkafkaOk returns a tuple with the Librdkafka field value +// and a boolean to check if the value has been set. +func (o *ClientConfig) GetLibrdkafkaOk() (ret ClientConfigGetLibrdkafkaRetType, ok bool) { + return getClientConfigGetLibrdkafkaAttributeTypeOk(o.Librdkafka) +} + +// SetLibrdkafka sets field value +func (o *ClientConfig) SetLibrdkafka(v ClientConfigGetLibrdkafkaRetType) { + setClientConfigGetLibrdkafkaAttributeType(&o.Librdkafka, v) +} + +func (o ClientConfig) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getClientConfigGetJavaAttributeTypeOk(o.Java); ok { + toSerialize["Java"] = val + } + if val, ok := getClientConfigGetLibrdkafkaAttributeTypeOk(o.Librdkafka); ok { + toSerialize["Librdkafka"] = val + } + return toSerialize, nil +} + +type NullableClientConfig struct { + value *ClientConfig + isSet bool +} + +func (v NullableClientConfig) Get() *ClientConfig { + return v.value +} + +func (v *NullableClientConfig) Set(val *ClientConfig) { + v.value = val + v.isSet = true +} + +func (v NullableClientConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableClientConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableClientConfig(val *ClientConfig) *NullableClientConfig { + return &NullableClientConfig{value: val, isSet: true} +} + +func (v NullableClientConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableClientConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/intake/model_client_config_test.go b/services/intake/model_client_config_test.go new file mode 100644 index 000000000..7a79462aa --- /dev/null +++ b/services/intake/model_client_config_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Intake API + +This API provides endpoints for managing Intakes. + +API version: 1beta.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package intake diff --git a/services/intake/model_create_intake_payload.go b/services/intake/model_create_intake_payload.go new file mode 100644 index 000000000..701c5488e --- /dev/null +++ b/services/intake/model_create_intake_payload.go @@ -0,0 +1,313 @@ +/* +STACKIT Intake API + +This API provides endpoints for managing Intakes. + +API version: 1beta.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package intake + +import ( + "encoding/json" +) + +// checks if the CreateIntakePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateIntakePayload{} + +/* + types and functions for catalog +*/ + +// isModel +type CreateIntakePayloadGetCatalogAttributeType = *IntakeCatalog +type CreateIntakePayloadGetCatalogArgType = IntakeCatalog +type CreateIntakePayloadGetCatalogRetType = IntakeCatalog + +func getCreateIntakePayloadGetCatalogAttributeTypeOk(arg CreateIntakePayloadGetCatalogAttributeType) (ret CreateIntakePayloadGetCatalogRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateIntakePayloadGetCatalogAttributeType(arg *CreateIntakePayloadGetCatalogAttributeType, val CreateIntakePayloadGetCatalogRetType) { + *arg = &val +} + +/* + types and functions for description +*/ + +// isNotNullableString +type CreateIntakePayloadGetDescriptionAttributeType = *string + +func getCreateIntakePayloadGetDescriptionAttributeTypeOk(arg CreateIntakePayloadGetDescriptionAttributeType) (ret CreateIntakePayloadGetDescriptionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateIntakePayloadGetDescriptionAttributeType(arg *CreateIntakePayloadGetDescriptionAttributeType, val CreateIntakePayloadGetDescriptionRetType) { + *arg = &val +} + +type CreateIntakePayloadGetDescriptionArgType = string +type CreateIntakePayloadGetDescriptionRetType = string + +/* + types and functions for displayName +*/ + +// isNotNullableString +type CreateIntakePayloadGetDisplayNameAttributeType = *string + +func getCreateIntakePayloadGetDisplayNameAttributeTypeOk(arg CreateIntakePayloadGetDisplayNameAttributeType) (ret CreateIntakePayloadGetDisplayNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateIntakePayloadGetDisplayNameAttributeType(arg *CreateIntakePayloadGetDisplayNameAttributeType, val CreateIntakePayloadGetDisplayNameRetType) { + *arg = &val +} + +type CreateIntakePayloadGetDisplayNameArgType = string +type CreateIntakePayloadGetDisplayNameRetType = string + +/* + types and functions for intakeRunnerId +*/ + +// isNotNullableString +type CreateIntakePayloadGetIntakeRunnerIdAttributeType = *string + +func getCreateIntakePayloadGetIntakeRunnerIdAttributeTypeOk(arg CreateIntakePayloadGetIntakeRunnerIdAttributeType) (ret CreateIntakePayloadGetIntakeRunnerIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateIntakePayloadGetIntakeRunnerIdAttributeType(arg *CreateIntakePayloadGetIntakeRunnerIdAttributeType, val CreateIntakePayloadGetIntakeRunnerIdRetType) { + *arg = &val +} + +type CreateIntakePayloadGetIntakeRunnerIdArgType = string +type CreateIntakePayloadGetIntakeRunnerIdRetType = string + +/* + types and functions for labels +*/ + +// isContainer +type CreateIntakePayloadGetLabelsAttributeType = *map[string]string +type CreateIntakePayloadGetLabelsArgType = *map[string]string +type CreateIntakePayloadGetLabelsRetType = *map[string]string + +func getCreateIntakePayloadGetLabelsAttributeTypeOk(arg CreateIntakePayloadGetLabelsAttributeType) (ret CreateIntakePayloadGetLabelsRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg, true +} + +func setCreateIntakePayloadGetLabelsAttributeType(arg *CreateIntakePayloadGetLabelsAttributeType, val CreateIntakePayloadGetLabelsRetType) { + *arg = val +} + +// CreateIntakePayload struct for CreateIntakePayload +type CreateIntakePayload struct { + // REQUIRED + Catalog CreateIntakePayloadGetCatalogAttributeType `json:"catalog" required:"true"` + // The description is a longer text chosen by the user to provide more context for the resource. + Description CreateIntakePayloadGetDescriptionAttributeType `json:"description,omitempty"` + // The display name is a short name chosen by the user to identify the resource. + // REQUIRED + DisplayName CreateIntakePayloadGetDisplayNameAttributeType `json:"displayName" required:"true"` + // The unique id of the intake runner this intake should run on. + // REQUIRED + IntakeRunnerId CreateIntakePayloadGetIntakeRunnerIdAttributeType `json:"intakeRunnerId" required:"true"` + // Labels are a set of key-value pairs assigned to resources. + Labels CreateIntakePayloadGetLabelsAttributeType `json:"labels,omitempty"` +} + +type _CreateIntakePayload CreateIntakePayload + +// NewCreateIntakePayload instantiates a new CreateIntakePayload 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 NewCreateIntakePayload(catalog CreateIntakePayloadGetCatalogArgType, displayName CreateIntakePayloadGetDisplayNameArgType, intakeRunnerId CreateIntakePayloadGetIntakeRunnerIdArgType) *CreateIntakePayload { + this := CreateIntakePayload{} + setCreateIntakePayloadGetCatalogAttributeType(&this.Catalog, catalog) + setCreateIntakePayloadGetDisplayNameAttributeType(&this.DisplayName, displayName) + setCreateIntakePayloadGetIntakeRunnerIdAttributeType(&this.IntakeRunnerId, intakeRunnerId) + return &this +} + +// NewCreateIntakePayloadWithDefaults instantiates a new CreateIntakePayload 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 NewCreateIntakePayloadWithDefaults() *CreateIntakePayload { + this := CreateIntakePayload{} + return &this +} + +// GetCatalog returns the Catalog field value +func (o *CreateIntakePayload) GetCatalog() (ret CreateIntakePayloadGetCatalogRetType) { + ret, _ = o.GetCatalogOk() + return ret +} + +// GetCatalogOk returns a tuple with the Catalog field value +// and a boolean to check if the value has been set. +func (o *CreateIntakePayload) GetCatalogOk() (ret CreateIntakePayloadGetCatalogRetType, ok bool) { + return getCreateIntakePayloadGetCatalogAttributeTypeOk(o.Catalog) +} + +// SetCatalog sets field value +func (o *CreateIntakePayload) SetCatalog(v CreateIntakePayloadGetCatalogRetType) { + setCreateIntakePayloadGetCatalogAttributeType(&o.Catalog, v) +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *CreateIntakePayload) GetDescription() (res CreateIntakePayloadGetDescriptionRetType) { + res, _ = o.GetDescriptionOk() + return +} + +// 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 *CreateIntakePayload) GetDescriptionOk() (ret CreateIntakePayloadGetDescriptionRetType, ok bool) { + return getCreateIntakePayloadGetDescriptionAttributeTypeOk(o.Description) +} + +// HasDescription returns a boolean if a field has been set. +func (o *CreateIntakePayload) HasDescription() bool { + _, ok := o.GetDescriptionOk() + return ok +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *CreateIntakePayload) SetDescription(v CreateIntakePayloadGetDescriptionRetType) { + setCreateIntakePayloadGetDescriptionAttributeType(&o.Description, v) +} + +// GetDisplayName returns the DisplayName field value +func (o *CreateIntakePayload) GetDisplayName() (ret CreateIntakePayloadGetDisplayNameRetType) { + ret, _ = o.GetDisplayNameOk() + return ret +} + +// GetDisplayNameOk returns a tuple with the DisplayName field value +// and a boolean to check if the value has been set. +func (o *CreateIntakePayload) GetDisplayNameOk() (ret CreateIntakePayloadGetDisplayNameRetType, ok bool) { + return getCreateIntakePayloadGetDisplayNameAttributeTypeOk(o.DisplayName) +} + +// SetDisplayName sets field value +func (o *CreateIntakePayload) SetDisplayName(v CreateIntakePayloadGetDisplayNameRetType) { + setCreateIntakePayloadGetDisplayNameAttributeType(&o.DisplayName, v) +} + +// GetIntakeRunnerId returns the IntakeRunnerId field value +func (o *CreateIntakePayload) GetIntakeRunnerId() (ret CreateIntakePayloadGetIntakeRunnerIdRetType) { + ret, _ = o.GetIntakeRunnerIdOk() + return ret +} + +// GetIntakeRunnerIdOk returns a tuple with the IntakeRunnerId field value +// and a boolean to check if the value has been set. +func (o *CreateIntakePayload) GetIntakeRunnerIdOk() (ret CreateIntakePayloadGetIntakeRunnerIdRetType, ok bool) { + return getCreateIntakePayloadGetIntakeRunnerIdAttributeTypeOk(o.IntakeRunnerId) +} + +// SetIntakeRunnerId sets field value +func (o *CreateIntakePayload) SetIntakeRunnerId(v CreateIntakePayloadGetIntakeRunnerIdRetType) { + setCreateIntakePayloadGetIntakeRunnerIdAttributeType(&o.IntakeRunnerId, v) +} + +// GetLabels returns the Labels field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreateIntakePayload) GetLabels() (res CreateIntakePayloadGetLabelsRetType) { + res, _ = o.GetLabelsOk() + return +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateIntakePayload) GetLabelsOk() (ret CreateIntakePayloadGetLabelsRetType, ok bool) { + return getCreateIntakePayloadGetLabelsAttributeTypeOk(o.Labels) +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreateIntakePayload) HasLabels() bool { + _, ok := o.GetLabelsOk() + return ok +} + +// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. +func (o *CreateIntakePayload) SetLabels(v CreateIntakePayloadGetLabelsRetType) { + setCreateIntakePayloadGetLabelsAttributeType(&o.Labels, v) +} + +func (o CreateIntakePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getCreateIntakePayloadGetCatalogAttributeTypeOk(o.Catalog); ok { + toSerialize["Catalog"] = val + } + if val, ok := getCreateIntakePayloadGetDescriptionAttributeTypeOk(o.Description); ok { + toSerialize["Description"] = val + } + if val, ok := getCreateIntakePayloadGetDisplayNameAttributeTypeOk(o.DisplayName); ok { + toSerialize["DisplayName"] = val + } + if val, ok := getCreateIntakePayloadGetIntakeRunnerIdAttributeTypeOk(o.IntakeRunnerId); ok { + toSerialize["IntakeRunnerId"] = val + } + if val, ok := getCreateIntakePayloadGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } + return toSerialize, nil +} + +type NullableCreateIntakePayload struct { + value *CreateIntakePayload + isSet bool +} + +func (v NullableCreateIntakePayload) Get() *CreateIntakePayload { + return v.value +} + +func (v *NullableCreateIntakePayload) Set(val *CreateIntakePayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateIntakePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateIntakePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateIntakePayload(val *CreateIntakePayload) *NullableCreateIntakePayload { + return &NullableCreateIntakePayload{value: val, isSet: true} +} + +func (v NullableCreateIntakePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateIntakePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/intake/model_create_intake_payload_test.go b/services/intake/model_create_intake_payload_test.go new file mode 100644 index 000000000..7a79462aa --- /dev/null +++ b/services/intake/model_create_intake_payload_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Intake API + +This API provides endpoints for managing Intakes. + +API version: 1beta.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package intake diff --git a/services/intake/model_create_intake_runner_payload.go b/services/intake/model_create_intake_runner_payload.go new file mode 100644 index 000000000..f44038565 --- /dev/null +++ b/services/intake/model_create_intake_runner_payload.go @@ -0,0 +1,313 @@ +/* +STACKIT Intake API + +This API provides endpoints for managing Intakes. + +API version: 1beta.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package intake + +import ( + "encoding/json" +) + +// checks if the CreateIntakeRunnerPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateIntakeRunnerPayload{} + +/* + types and functions for description +*/ + +// isNotNullableString +type CreateIntakeRunnerPayloadGetDescriptionAttributeType = *string + +func getCreateIntakeRunnerPayloadGetDescriptionAttributeTypeOk(arg CreateIntakeRunnerPayloadGetDescriptionAttributeType) (ret CreateIntakeRunnerPayloadGetDescriptionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateIntakeRunnerPayloadGetDescriptionAttributeType(arg *CreateIntakeRunnerPayloadGetDescriptionAttributeType, val CreateIntakeRunnerPayloadGetDescriptionRetType) { + *arg = &val +} + +type CreateIntakeRunnerPayloadGetDescriptionArgType = string +type CreateIntakeRunnerPayloadGetDescriptionRetType = string + +/* + types and functions for displayName +*/ + +// isNotNullableString +type CreateIntakeRunnerPayloadGetDisplayNameAttributeType = *string + +func getCreateIntakeRunnerPayloadGetDisplayNameAttributeTypeOk(arg CreateIntakeRunnerPayloadGetDisplayNameAttributeType) (ret CreateIntakeRunnerPayloadGetDisplayNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateIntakeRunnerPayloadGetDisplayNameAttributeType(arg *CreateIntakeRunnerPayloadGetDisplayNameAttributeType, val CreateIntakeRunnerPayloadGetDisplayNameRetType) { + *arg = &val +} + +type CreateIntakeRunnerPayloadGetDisplayNameArgType = string +type CreateIntakeRunnerPayloadGetDisplayNameRetType = string + +/* + types and functions for labels +*/ + +// isContainer +type CreateIntakeRunnerPayloadGetLabelsAttributeType = *map[string]string +type CreateIntakeRunnerPayloadGetLabelsArgType = *map[string]string +type CreateIntakeRunnerPayloadGetLabelsRetType = *map[string]string + +func getCreateIntakeRunnerPayloadGetLabelsAttributeTypeOk(arg CreateIntakeRunnerPayloadGetLabelsAttributeType) (ret CreateIntakeRunnerPayloadGetLabelsRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg, true +} + +func setCreateIntakeRunnerPayloadGetLabelsAttributeType(arg *CreateIntakeRunnerPayloadGetLabelsAttributeType, val CreateIntakeRunnerPayloadGetLabelsRetType) { + *arg = val +} + +/* + types and functions for maxMessageSizeKiB +*/ + +// isInteger +type CreateIntakeRunnerPayloadGetMaxMessageSizeKiBAttributeType = *int64 +type CreateIntakeRunnerPayloadGetMaxMessageSizeKiBArgType = int64 +type CreateIntakeRunnerPayloadGetMaxMessageSizeKiBRetType = int64 + +func getCreateIntakeRunnerPayloadGetMaxMessageSizeKiBAttributeTypeOk(arg CreateIntakeRunnerPayloadGetMaxMessageSizeKiBAttributeType) (ret CreateIntakeRunnerPayloadGetMaxMessageSizeKiBRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateIntakeRunnerPayloadGetMaxMessageSizeKiBAttributeType(arg *CreateIntakeRunnerPayloadGetMaxMessageSizeKiBAttributeType, val CreateIntakeRunnerPayloadGetMaxMessageSizeKiBRetType) { + *arg = &val +} + +/* + types and functions for maxMessagesPerHour +*/ + +// isInteger +type CreateIntakeRunnerPayloadGetMaxMessagesPerHourAttributeType = *int64 +type CreateIntakeRunnerPayloadGetMaxMessagesPerHourArgType = int64 +type CreateIntakeRunnerPayloadGetMaxMessagesPerHourRetType = int64 + +func getCreateIntakeRunnerPayloadGetMaxMessagesPerHourAttributeTypeOk(arg CreateIntakeRunnerPayloadGetMaxMessagesPerHourAttributeType) (ret CreateIntakeRunnerPayloadGetMaxMessagesPerHourRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateIntakeRunnerPayloadGetMaxMessagesPerHourAttributeType(arg *CreateIntakeRunnerPayloadGetMaxMessagesPerHourAttributeType, val CreateIntakeRunnerPayloadGetMaxMessagesPerHourRetType) { + *arg = &val +} + +// CreateIntakeRunnerPayload struct for CreateIntakeRunnerPayload +type CreateIntakeRunnerPayload struct { + // The description is a longer text chosen by the user to provide more context for the resource. + Description CreateIntakeRunnerPayloadGetDescriptionAttributeType `json:"description,omitempty"` + // The display name is a short name chosen by the user to identify the resource. + // REQUIRED + DisplayName CreateIntakeRunnerPayloadGetDisplayNameAttributeType `json:"displayName" required:"true"` + // Labels are a set of key-value pairs assigned to resources. + Labels CreateIntakeRunnerPayloadGetLabelsAttributeType `json:"labels,omitempty"` + // The maximum size of a message in kibibytes (1 KiB = 1024 bytes). + // REQUIRED + MaxMessageSizeKiB CreateIntakeRunnerPayloadGetMaxMessageSizeKiBAttributeType `json:"maxMessageSizeKiB" required:"true"` + // The maximum number of messages per hour. + // REQUIRED + MaxMessagesPerHour CreateIntakeRunnerPayloadGetMaxMessagesPerHourAttributeType `json:"maxMessagesPerHour" required:"true"` +} + +type _CreateIntakeRunnerPayload CreateIntakeRunnerPayload + +// NewCreateIntakeRunnerPayload instantiates a new CreateIntakeRunnerPayload 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 NewCreateIntakeRunnerPayload(displayName CreateIntakeRunnerPayloadGetDisplayNameArgType, maxMessageSizeKiB CreateIntakeRunnerPayloadGetMaxMessageSizeKiBArgType, maxMessagesPerHour CreateIntakeRunnerPayloadGetMaxMessagesPerHourArgType) *CreateIntakeRunnerPayload { + this := CreateIntakeRunnerPayload{} + setCreateIntakeRunnerPayloadGetDisplayNameAttributeType(&this.DisplayName, displayName) + setCreateIntakeRunnerPayloadGetMaxMessageSizeKiBAttributeType(&this.MaxMessageSizeKiB, maxMessageSizeKiB) + setCreateIntakeRunnerPayloadGetMaxMessagesPerHourAttributeType(&this.MaxMessagesPerHour, maxMessagesPerHour) + return &this +} + +// NewCreateIntakeRunnerPayloadWithDefaults instantiates a new CreateIntakeRunnerPayload 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 NewCreateIntakeRunnerPayloadWithDefaults() *CreateIntakeRunnerPayload { + this := CreateIntakeRunnerPayload{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *CreateIntakeRunnerPayload) GetDescription() (res CreateIntakeRunnerPayloadGetDescriptionRetType) { + res, _ = o.GetDescriptionOk() + return +} + +// 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 *CreateIntakeRunnerPayload) GetDescriptionOk() (ret CreateIntakeRunnerPayloadGetDescriptionRetType, ok bool) { + return getCreateIntakeRunnerPayloadGetDescriptionAttributeTypeOk(o.Description) +} + +// HasDescription returns a boolean if a field has been set. +func (o *CreateIntakeRunnerPayload) HasDescription() bool { + _, ok := o.GetDescriptionOk() + return ok +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *CreateIntakeRunnerPayload) SetDescription(v CreateIntakeRunnerPayloadGetDescriptionRetType) { + setCreateIntakeRunnerPayloadGetDescriptionAttributeType(&o.Description, v) +} + +// GetDisplayName returns the DisplayName field value +func (o *CreateIntakeRunnerPayload) GetDisplayName() (ret CreateIntakeRunnerPayloadGetDisplayNameRetType) { + ret, _ = o.GetDisplayNameOk() + return ret +} + +// GetDisplayNameOk returns a tuple with the DisplayName field value +// and a boolean to check if the value has been set. +func (o *CreateIntakeRunnerPayload) GetDisplayNameOk() (ret CreateIntakeRunnerPayloadGetDisplayNameRetType, ok bool) { + return getCreateIntakeRunnerPayloadGetDisplayNameAttributeTypeOk(o.DisplayName) +} + +// SetDisplayName sets field value +func (o *CreateIntakeRunnerPayload) SetDisplayName(v CreateIntakeRunnerPayloadGetDisplayNameRetType) { + setCreateIntakeRunnerPayloadGetDisplayNameAttributeType(&o.DisplayName, v) +} + +// GetLabels returns the Labels field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreateIntakeRunnerPayload) GetLabels() (res CreateIntakeRunnerPayloadGetLabelsRetType) { + res, _ = o.GetLabelsOk() + return +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateIntakeRunnerPayload) GetLabelsOk() (ret CreateIntakeRunnerPayloadGetLabelsRetType, ok bool) { + return getCreateIntakeRunnerPayloadGetLabelsAttributeTypeOk(o.Labels) +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreateIntakeRunnerPayload) HasLabels() bool { + _, ok := o.GetLabelsOk() + return ok +} + +// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. +func (o *CreateIntakeRunnerPayload) SetLabels(v CreateIntakeRunnerPayloadGetLabelsRetType) { + setCreateIntakeRunnerPayloadGetLabelsAttributeType(&o.Labels, v) +} + +// GetMaxMessageSizeKiB returns the MaxMessageSizeKiB field value +func (o *CreateIntakeRunnerPayload) GetMaxMessageSizeKiB() (ret CreateIntakeRunnerPayloadGetMaxMessageSizeKiBRetType) { + ret, _ = o.GetMaxMessageSizeKiBOk() + return ret +} + +// GetMaxMessageSizeKiBOk returns a tuple with the MaxMessageSizeKiB field value +// and a boolean to check if the value has been set. +func (o *CreateIntakeRunnerPayload) GetMaxMessageSizeKiBOk() (ret CreateIntakeRunnerPayloadGetMaxMessageSizeKiBRetType, ok bool) { + return getCreateIntakeRunnerPayloadGetMaxMessageSizeKiBAttributeTypeOk(o.MaxMessageSizeKiB) +} + +// SetMaxMessageSizeKiB sets field value +func (o *CreateIntakeRunnerPayload) SetMaxMessageSizeKiB(v CreateIntakeRunnerPayloadGetMaxMessageSizeKiBRetType) { + setCreateIntakeRunnerPayloadGetMaxMessageSizeKiBAttributeType(&o.MaxMessageSizeKiB, v) +} + +// GetMaxMessagesPerHour returns the MaxMessagesPerHour field value +func (o *CreateIntakeRunnerPayload) GetMaxMessagesPerHour() (ret CreateIntakeRunnerPayloadGetMaxMessagesPerHourRetType) { + ret, _ = o.GetMaxMessagesPerHourOk() + return ret +} + +// GetMaxMessagesPerHourOk returns a tuple with the MaxMessagesPerHour field value +// and a boolean to check if the value has been set. +func (o *CreateIntakeRunnerPayload) GetMaxMessagesPerHourOk() (ret CreateIntakeRunnerPayloadGetMaxMessagesPerHourRetType, ok bool) { + return getCreateIntakeRunnerPayloadGetMaxMessagesPerHourAttributeTypeOk(o.MaxMessagesPerHour) +} + +// SetMaxMessagesPerHour sets field value +func (o *CreateIntakeRunnerPayload) SetMaxMessagesPerHour(v CreateIntakeRunnerPayloadGetMaxMessagesPerHourRetType) { + setCreateIntakeRunnerPayloadGetMaxMessagesPerHourAttributeType(&o.MaxMessagesPerHour, v) +} + +func (o CreateIntakeRunnerPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getCreateIntakeRunnerPayloadGetDescriptionAttributeTypeOk(o.Description); ok { + toSerialize["Description"] = val + } + if val, ok := getCreateIntakeRunnerPayloadGetDisplayNameAttributeTypeOk(o.DisplayName); ok { + toSerialize["DisplayName"] = val + } + if val, ok := getCreateIntakeRunnerPayloadGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } + if val, ok := getCreateIntakeRunnerPayloadGetMaxMessageSizeKiBAttributeTypeOk(o.MaxMessageSizeKiB); ok { + toSerialize["MaxMessageSizeKiB"] = val + } + if val, ok := getCreateIntakeRunnerPayloadGetMaxMessagesPerHourAttributeTypeOk(o.MaxMessagesPerHour); ok { + toSerialize["MaxMessagesPerHour"] = val + } + return toSerialize, nil +} + +type NullableCreateIntakeRunnerPayload struct { + value *CreateIntakeRunnerPayload + isSet bool +} + +func (v NullableCreateIntakeRunnerPayload) Get() *CreateIntakeRunnerPayload { + return v.value +} + +func (v *NullableCreateIntakeRunnerPayload) Set(val *CreateIntakeRunnerPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateIntakeRunnerPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateIntakeRunnerPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateIntakeRunnerPayload(val *CreateIntakeRunnerPayload) *NullableCreateIntakeRunnerPayload { + return &NullableCreateIntakeRunnerPayload{value: val, isSet: true} +} + +func (v NullableCreateIntakeRunnerPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateIntakeRunnerPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/intake/model_create_intake_runner_payload_test.go b/services/intake/model_create_intake_runner_payload_test.go new file mode 100644 index 000000000..7a79462aa --- /dev/null +++ b/services/intake/model_create_intake_runner_payload_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Intake API + +This API provides endpoints for managing Intakes. + +API version: 1beta.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package intake diff --git a/services/intake/model_create_intake_user_payload.go b/services/intake/model_create_intake_user_payload.go new file mode 100644 index 000000000..fd8df35f7 --- /dev/null +++ b/services/intake/model_create_intake_user_payload.go @@ -0,0 +1,319 @@ +/* +STACKIT Intake API + +This API provides endpoints for managing Intakes. + +API version: 1beta.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package intake + +import ( + "encoding/json" +) + +// checks if the CreateIntakeUserPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateIntakeUserPayload{} + +/* + types and functions for description +*/ + +// isNotNullableString +type CreateIntakeUserPayloadGetDescriptionAttributeType = *string + +func getCreateIntakeUserPayloadGetDescriptionAttributeTypeOk(arg CreateIntakeUserPayloadGetDescriptionAttributeType) (ret CreateIntakeUserPayloadGetDescriptionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateIntakeUserPayloadGetDescriptionAttributeType(arg *CreateIntakeUserPayloadGetDescriptionAttributeType, val CreateIntakeUserPayloadGetDescriptionRetType) { + *arg = &val +} + +type CreateIntakeUserPayloadGetDescriptionArgType = string +type CreateIntakeUserPayloadGetDescriptionRetType = string + +/* + types and functions for displayName +*/ + +// isNotNullableString +type CreateIntakeUserPayloadGetDisplayNameAttributeType = *string + +func getCreateIntakeUserPayloadGetDisplayNameAttributeTypeOk(arg CreateIntakeUserPayloadGetDisplayNameAttributeType) (ret CreateIntakeUserPayloadGetDisplayNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateIntakeUserPayloadGetDisplayNameAttributeType(arg *CreateIntakeUserPayloadGetDisplayNameAttributeType, val CreateIntakeUserPayloadGetDisplayNameRetType) { + *arg = &val +} + +type CreateIntakeUserPayloadGetDisplayNameArgType = string +type CreateIntakeUserPayloadGetDisplayNameRetType = string + +/* + types and functions for labels +*/ + +// isContainer +type CreateIntakeUserPayloadGetLabelsAttributeType = *map[string]string +type CreateIntakeUserPayloadGetLabelsArgType = *map[string]string +type CreateIntakeUserPayloadGetLabelsRetType = *map[string]string + +func getCreateIntakeUserPayloadGetLabelsAttributeTypeOk(arg CreateIntakeUserPayloadGetLabelsAttributeType) (ret CreateIntakeUserPayloadGetLabelsRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg, true +} + +func setCreateIntakeUserPayloadGetLabelsAttributeType(arg *CreateIntakeUserPayloadGetLabelsAttributeType, val CreateIntakeUserPayloadGetLabelsRetType) { + *arg = val +} + +/* + types and functions for password +*/ + +// isNotNullableString +type CreateIntakeUserPayloadGetPasswordAttributeType = *string + +func getCreateIntakeUserPayloadGetPasswordAttributeTypeOk(arg CreateIntakeUserPayloadGetPasswordAttributeType) (ret CreateIntakeUserPayloadGetPasswordRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateIntakeUserPayloadGetPasswordAttributeType(arg *CreateIntakeUserPayloadGetPasswordAttributeType, val CreateIntakeUserPayloadGetPasswordRetType) { + *arg = &val +} + +type CreateIntakeUserPayloadGetPasswordArgType = string +type CreateIntakeUserPayloadGetPasswordRetType = string + +/* + types and functions for type +*/ + +// isEnumRef +type CreateIntakeUserPayloadGetTypeAttributeType = *UserType +type CreateIntakeUserPayloadGetTypeArgType = UserType +type CreateIntakeUserPayloadGetTypeRetType = UserType + +func getCreateIntakeUserPayloadGetTypeAttributeTypeOk(arg CreateIntakeUserPayloadGetTypeAttributeType) (ret CreateIntakeUserPayloadGetTypeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateIntakeUserPayloadGetTypeAttributeType(arg *CreateIntakeUserPayloadGetTypeAttributeType, val CreateIntakeUserPayloadGetTypeRetType) { + *arg = &val +} + +// CreateIntakeUserPayload struct for CreateIntakeUserPayload +type CreateIntakeUserPayload struct { + // The description is a longer text chosen by the user to provide more context for the resource. + Description CreateIntakeUserPayloadGetDescriptionAttributeType `json:"description,omitempty"` + // The display name is a short name chosen by the user to identify the resource. + // REQUIRED + DisplayName CreateIntakeUserPayloadGetDisplayNameAttributeType `json:"displayName" required:"true"` + // Labels are key-value pairs associated with the resource. + Labels CreateIntakeUserPayloadGetLabelsAttributeType `json:"labels,omitempty"` + // A password chosen by the user. + // REQUIRED + Password CreateIntakeUserPayloadGetPasswordAttributeType `json:"password" required:"true"` + Type CreateIntakeUserPayloadGetTypeAttributeType `json:"type,omitempty"` +} + +type _CreateIntakeUserPayload CreateIntakeUserPayload + +// NewCreateIntakeUserPayload instantiates a new CreateIntakeUserPayload 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 NewCreateIntakeUserPayload(displayName CreateIntakeUserPayloadGetDisplayNameArgType, password CreateIntakeUserPayloadGetPasswordArgType) *CreateIntakeUserPayload { + this := CreateIntakeUserPayload{} + setCreateIntakeUserPayloadGetDisplayNameAttributeType(&this.DisplayName, displayName) + setCreateIntakeUserPayloadGetPasswordAttributeType(&this.Password, password) + return &this +} + +// NewCreateIntakeUserPayloadWithDefaults instantiates a new CreateIntakeUserPayload 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 NewCreateIntakeUserPayloadWithDefaults() *CreateIntakeUserPayload { + this := CreateIntakeUserPayload{} + var types UserType = USERTYPE_INTAKE + this.Type = &types + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *CreateIntakeUserPayload) GetDescription() (res CreateIntakeUserPayloadGetDescriptionRetType) { + res, _ = o.GetDescriptionOk() + return +} + +// 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 *CreateIntakeUserPayload) GetDescriptionOk() (ret CreateIntakeUserPayloadGetDescriptionRetType, ok bool) { + return getCreateIntakeUserPayloadGetDescriptionAttributeTypeOk(o.Description) +} + +// HasDescription returns a boolean if a field has been set. +func (o *CreateIntakeUserPayload) HasDescription() bool { + _, ok := o.GetDescriptionOk() + return ok +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *CreateIntakeUserPayload) SetDescription(v CreateIntakeUserPayloadGetDescriptionRetType) { + setCreateIntakeUserPayloadGetDescriptionAttributeType(&o.Description, v) +} + +// GetDisplayName returns the DisplayName field value +func (o *CreateIntakeUserPayload) GetDisplayName() (ret CreateIntakeUserPayloadGetDisplayNameRetType) { + ret, _ = o.GetDisplayNameOk() + return ret +} + +// GetDisplayNameOk returns a tuple with the DisplayName field value +// and a boolean to check if the value has been set. +func (o *CreateIntakeUserPayload) GetDisplayNameOk() (ret CreateIntakeUserPayloadGetDisplayNameRetType, ok bool) { + return getCreateIntakeUserPayloadGetDisplayNameAttributeTypeOk(o.DisplayName) +} + +// SetDisplayName sets field value +func (o *CreateIntakeUserPayload) SetDisplayName(v CreateIntakeUserPayloadGetDisplayNameRetType) { + setCreateIntakeUserPayloadGetDisplayNameAttributeType(&o.DisplayName, v) +} + +// GetLabels returns the Labels field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreateIntakeUserPayload) GetLabels() (res CreateIntakeUserPayloadGetLabelsRetType) { + res, _ = o.GetLabelsOk() + return +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateIntakeUserPayload) GetLabelsOk() (ret CreateIntakeUserPayloadGetLabelsRetType, ok bool) { + return getCreateIntakeUserPayloadGetLabelsAttributeTypeOk(o.Labels) +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreateIntakeUserPayload) HasLabels() bool { + _, ok := o.GetLabelsOk() + return ok +} + +// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. +func (o *CreateIntakeUserPayload) SetLabels(v CreateIntakeUserPayloadGetLabelsRetType) { + setCreateIntakeUserPayloadGetLabelsAttributeType(&o.Labels, v) +} + +// GetPassword returns the Password field value +func (o *CreateIntakeUserPayload) GetPassword() (ret CreateIntakeUserPayloadGetPasswordRetType) { + ret, _ = o.GetPasswordOk() + return ret +} + +// GetPasswordOk returns a tuple with the Password field value +// and a boolean to check if the value has been set. +func (o *CreateIntakeUserPayload) GetPasswordOk() (ret CreateIntakeUserPayloadGetPasswordRetType, ok bool) { + return getCreateIntakeUserPayloadGetPasswordAttributeTypeOk(o.Password) +} + +// SetPassword sets field value +func (o *CreateIntakeUserPayload) SetPassword(v CreateIntakeUserPayloadGetPasswordRetType) { + setCreateIntakeUserPayloadGetPasswordAttributeType(&o.Password, v) +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *CreateIntakeUserPayload) GetType() (res CreateIntakeUserPayloadGetTypeRetType) { + res, _ = o.GetTypeOk() + return +} + +// 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 *CreateIntakeUserPayload) GetTypeOk() (ret CreateIntakeUserPayloadGetTypeRetType, ok bool) { + return getCreateIntakeUserPayloadGetTypeAttributeTypeOk(o.Type) +} + +// HasType returns a boolean if a field has been set. +func (o *CreateIntakeUserPayload) HasType() bool { + _, ok := o.GetTypeOk() + return ok +} + +// SetType gets a reference to the given UserType and assigns it to the Type field. +func (o *CreateIntakeUserPayload) SetType(v CreateIntakeUserPayloadGetTypeRetType) { + setCreateIntakeUserPayloadGetTypeAttributeType(&o.Type, v) +} + +func (o CreateIntakeUserPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getCreateIntakeUserPayloadGetDescriptionAttributeTypeOk(o.Description); ok { + toSerialize["Description"] = val + } + if val, ok := getCreateIntakeUserPayloadGetDisplayNameAttributeTypeOk(o.DisplayName); ok { + toSerialize["DisplayName"] = val + } + if val, ok := getCreateIntakeUserPayloadGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } + if val, ok := getCreateIntakeUserPayloadGetPasswordAttributeTypeOk(o.Password); ok { + toSerialize["Password"] = val + } + if val, ok := getCreateIntakeUserPayloadGetTypeAttributeTypeOk(o.Type); ok { + toSerialize["Type"] = val + } + return toSerialize, nil +} + +type NullableCreateIntakeUserPayload struct { + value *CreateIntakeUserPayload + isSet bool +} + +func (v NullableCreateIntakeUserPayload) Get() *CreateIntakeUserPayload { + return v.value +} + +func (v *NullableCreateIntakeUserPayload) Set(val *CreateIntakeUserPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateIntakeUserPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateIntakeUserPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateIntakeUserPayload(val *CreateIntakeUserPayload) *NullableCreateIntakeUserPayload { + return &NullableCreateIntakeUserPayload{value: val, isSet: true} +} + +func (v NullableCreateIntakeUserPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateIntakeUserPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/intake/model_create_intake_user_payload_test.go b/services/intake/model_create_intake_user_payload_test.go new file mode 100644 index 000000000..7a79462aa --- /dev/null +++ b/services/intake/model_create_intake_user_payload_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Intake API + +This API provides endpoints for managing Intakes. + +API version: 1beta.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package intake diff --git a/services/intake/model_dremio_auth.go b/services/intake/model_dremio_auth.go new file mode 100644 index 000000000..ffe48931c --- /dev/null +++ b/services/intake/model_dremio_auth.go @@ -0,0 +1,172 @@ +/* +STACKIT Intake API + +This API provides endpoints for managing Intakes. + +API version: 1beta.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package intake + +import ( + "encoding/json" +) + +// checks if the DremioAuth type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DremioAuth{} + +/* + types and functions for personalAccessToken +*/ + +// isNotNullableString +type DremioAuthGetPersonalAccessTokenAttributeType = *string + +func getDremioAuthGetPersonalAccessTokenAttributeTypeOk(arg DremioAuthGetPersonalAccessTokenAttributeType) (ret DremioAuthGetPersonalAccessTokenRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setDremioAuthGetPersonalAccessTokenAttributeType(arg *DremioAuthGetPersonalAccessTokenAttributeType, val DremioAuthGetPersonalAccessTokenRetType) { + *arg = &val +} + +type DremioAuthGetPersonalAccessTokenArgType = string +type DremioAuthGetPersonalAccessTokenRetType = string + +/* + types and functions for tokenEndpoint +*/ + +// isNotNullableString +type DremioAuthGetTokenEndpointAttributeType = *string + +func getDremioAuthGetTokenEndpointAttributeTypeOk(arg DremioAuthGetTokenEndpointAttributeType) (ret DremioAuthGetTokenEndpointRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setDremioAuthGetTokenEndpointAttributeType(arg *DremioAuthGetTokenEndpointAttributeType, val DremioAuthGetTokenEndpointRetType) { + *arg = &val +} + +type DremioAuthGetTokenEndpointArgType = string +type DremioAuthGetTokenEndpointRetType = string + +// DremioAuth struct for DremioAuth +type DremioAuth struct { + // A Dremio personal access token for authentication + // REQUIRED + PersonalAccessToken DremioAuthGetPersonalAccessTokenAttributeType `json:"personalAccessToken" required:"true"` + // The URL to the Dremio instance's OAuth 2.0 token endpoint + // REQUIRED + TokenEndpoint DremioAuthGetTokenEndpointAttributeType `json:"tokenEndpoint" required:"true"` +} + +type _DremioAuth DremioAuth + +// NewDremioAuth instantiates a new DremioAuth 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 NewDremioAuth(personalAccessToken DremioAuthGetPersonalAccessTokenArgType, tokenEndpoint DremioAuthGetTokenEndpointArgType) *DremioAuth { + this := DremioAuth{} + setDremioAuthGetPersonalAccessTokenAttributeType(&this.PersonalAccessToken, personalAccessToken) + setDremioAuthGetTokenEndpointAttributeType(&this.TokenEndpoint, tokenEndpoint) + return &this +} + +// NewDremioAuthWithDefaults instantiates a new DremioAuth 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 NewDremioAuthWithDefaults() *DremioAuth { + this := DremioAuth{} + return &this +} + +// GetPersonalAccessToken returns the PersonalAccessToken field value +func (o *DremioAuth) GetPersonalAccessToken() (ret DremioAuthGetPersonalAccessTokenRetType) { + ret, _ = o.GetPersonalAccessTokenOk() + return ret +} + +// GetPersonalAccessTokenOk returns a tuple with the PersonalAccessToken field value +// and a boolean to check if the value has been set. +func (o *DremioAuth) GetPersonalAccessTokenOk() (ret DremioAuthGetPersonalAccessTokenRetType, ok bool) { + return getDremioAuthGetPersonalAccessTokenAttributeTypeOk(o.PersonalAccessToken) +} + +// SetPersonalAccessToken sets field value +func (o *DremioAuth) SetPersonalAccessToken(v DremioAuthGetPersonalAccessTokenRetType) { + setDremioAuthGetPersonalAccessTokenAttributeType(&o.PersonalAccessToken, v) +} + +// GetTokenEndpoint returns the TokenEndpoint field value +func (o *DremioAuth) GetTokenEndpoint() (ret DremioAuthGetTokenEndpointRetType) { + ret, _ = o.GetTokenEndpointOk() + return ret +} + +// GetTokenEndpointOk returns a tuple with the TokenEndpoint field value +// and a boolean to check if the value has been set. +func (o *DremioAuth) GetTokenEndpointOk() (ret DremioAuthGetTokenEndpointRetType, ok bool) { + return getDremioAuthGetTokenEndpointAttributeTypeOk(o.TokenEndpoint) +} + +// SetTokenEndpoint sets field value +func (o *DremioAuth) SetTokenEndpoint(v DremioAuthGetTokenEndpointRetType) { + setDremioAuthGetTokenEndpointAttributeType(&o.TokenEndpoint, v) +} + +func (o DremioAuth) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getDremioAuthGetPersonalAccessTokenAttributeTypeOk(o.PersonalAccessToken); ok { + toSerialize["PersonalAccessToken"] = val + } + if val, ok := getDremioAuthGetTokenEndpointAttributeTypeOk(o.TokenEndpoint); ok { + toSerialize["TokenEndpoint"] = val + } + return toSerialize, nil +} + +type NullableDremioAuth struct { + value *DremioAuth + isSet bool +} + +func (v NullableDremioAuth) Get() *DremioAuth { + return v.value +} + +func (v *NullableDremioAuth) Set(val *DremioAuth) { + v.value = val + v.isSet = true +} + +func (v NullableDremioAuth) IsSet() bool { + return v.isSet +} + +func (v *NullableDremioAuth) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDremioAuth(val *DremioAuth) *NullableDremioAuth { + return &NullableDremioAuth{value: val, isSet: true} +} + +func (v NullableDremioAuth) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDremioAuth) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/intake/model_dremio_auth_patch.go b/services/intake/model_dremio_auth_patch.go new file mode 100644 index 000000000..c7cbbdbf4 --- /dev/null +++ b/services/intake/model_dremio_auth_patch.go @@ -0,0 +1,178 @@ +/* +STACKIT Intake API + +This API provides endpoints for managing Intakes. + +API version: 1beta.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package intake + +import ( + "encoding/json" +) + +// checks if the DremioAuthPatch type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DremioAuthPatch{} + +/* + types and functions for personalAccessToken +*/ + +// isNotNullableString +type DremioAuthPatchGetPersonalAccessTokenAttributeType = *string + +func getDremioAuthPatchGetPersonalAccessTokenAttributeTypeOk(arg DremioAuthPatchGetPersonalAccessTokenAttributeType) (ret DremioAuthPatchGetPersonalAccessTokenRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setDremioAuthPatchGetPersonalAccessTokenAttributeType(arg *DremioAuthPatchGetPersonalAccessTokenAttributeType, val DremioAuthPatchGetPersonalAccessTokenRetType) { + *arg = &val +} + +type DremioAuthPatchGetPersonalAccessTokenArgType = string +type DremioAuthPatchGetPersonalAccessTokenRetType = string + +/* + types and functions for tokenEndpoint +*/ + +// isNotNullableString +type DremioAuthPatchGetTokenEndpointAttributeType = *string + +func getDremioAuthPatchGetTokenEndpointAttributeTypeOk(arg DremioAuthPatchGetTokenEndpointAttributeType) (ret DremioAuthPatchGetTokenEndpointRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setDremioAuthPatchGetTokenEndpointAttributeType(arg *DremioAuthPatchGetTokenEndpointAttributeType, val DremioAuthPatchGetTokenEndpointRetType) { + *arg = &val +} + +type DremioAuthPatchGetTokenEndpointArgType = string +type DremioAuthPatchGetTokenEndpointRetType = string + +// DremioAuthPatch struct for DremioAuthPatch +type DremioAuthPatch struct { + // A Dremio personal access token for authentication + PersonalAccessToken DremioAuthPatchGetPersonalAccessTokenAttributeType `json:"personalAccessToken,omitempty"` + // The URL to the Dremio instance's OAuth 2.0 token endpoint + TokenEndpoint DremioAuthPatchGetTokenEndpointAttributeType `json:"tokenEndpoint,omitempty"` +} + +// NewDremioAuthPatch instantiates a new DremioAuthPatch 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 NewDremioAuthPatch() *DremioAuthPatch { + this := DremioAuthPatch{} + return &this +} + +// NewDremioAuthPatchWithDefaults instantiates a new DremioAuthPatch 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 NewDremioAuthPatchWithDefaults() *DremioAuthPatch { + this := DremioAuthPatch{} + return &this +} + +// GetPersonalAccessToken returns the PersonalAccessToken field value if set, zero value otherwise. +func (o *DremioAuthPatch) GetPersonalAccessToken() (res DremioAuthPatchGetPersonalAccessTokenRetType) { + res, _ = o.GetPersonalAccessTokenOk() + return +} + +// GetPersonalAccessTokenOk returns a tuple with the PersonalAccessToken field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DremioAuthPatch) GetPersonalAccessTokenOk() (ret DremioAuthPatchGetPersonalAccessTokenRetType, ok bool) { + return getDremioAuthPatchGetPersonalAccessTokenAttributeTypeOk(o.PersonalAccessToken) +} + +// HasPersonalAccessToken returns a boolean if a field has been set. +func (o *DremioAuthPatch) HasPersonalAccessToken() bool { + _, ok := o.GetPersonalAccessTokenOk() + return ok +} + +// SetPersonalAccessToken gets a reference to the given string and assigns it to the PersonalAccessToken field. +func (o *DremioAuthPatch) SetPersonalAccessToken(v DremioAuthPatchGetPersonalAccessTokenRetType) { + setDremioAuthPatchGetPersonalAccessTokenAttributeType(&o.PersonalAccessToken, v) +} + +// GetTokenEndpoint returns the TokenEndpoint field value if set, zero value otherwise. +func (o *DremioAuthPatch) GetTokenEndpoint() (res DremioAuthPatchGetTokenEndpointRetType) { + res, _ = o.GetTokenEndpointOk() + return +} + +// GetTokenEndpointOk returns a tuple with the TokenEndpoint field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DremioAuthPatch) GetTokenEndpointOk() (ret DremioAuthPatchGetTokenEndpointRetType, ok bool) { + return getDremioAuthPatchGetTokenEndpointAttributeTypeOk(o.TokenEndpoint) +} + +// HasTokenEndpoint returns a boolean if a field has been set. +func (o *DremioAuthPatch) HasTokenEndpoint() bool { + _, ok := o.GetTokenEndpointOk() + return ok +} + +// SetTokenEndpoint gets a reference to the given string and assigns it to the TokenEndpoint field. +func (o *DremioAuthPatch) SetTokenEndpoint(v DremioAuthPatchGetTokenEndpointRetType) { + setDremioAuthPatchGetTokenEndpointAttributeType(&o.TokenEndpoint, v) +} + +func (o DremioAuthPatch) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getDremioAuthPatchGetPersonalAccessTokenAttributeTypeOk(o.PersonalAccessToken); ok { + toSerialize["PersonalAccessToken"] = val + } + if val, ok := getDremioAuthPatchGetTokenEndpointAttributeTypeOk(o.TokenEndpoint); ok { + toSerialize["TokenEndpoint"] = val + } + return toSerialize, nil +} + +type NullableDremioAuthPatch struct { + value *DremioAuthPatch + isSet bool +} + +func (v NullableDremioAuthPatch) Get() *DremioAuthPatch { + return v.value +} + +func (v *NullableDremioAuthPatch) Set(val *DremioAuthPatch) { + v.value = val + v.isSet = true +} + +func (v NullableDremioAuthPatch) IsSet() bool { + return v.isSet +} + +func (v *NullableDremioAuthPatch) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDremioAuthPatch(val *DremioAuthPatch) *NullableDremioAuthPatch { + return &NullableDremioAuthPatch{value: val, isSet: true} +} + +func (v NullableDremioAuthPatch) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDremioAuthPatch) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/intake/model_dremio_auth_patch_test.go b/services/intake/model_dremio_auth_patch_test.go new file mode 100644 index 000000000..7a79462aa --- /dev/null +++ b/services/intake/model_dremio_auth_patch_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Intake API + +This API provides endpoints for managing Intakes. + +API version: 1beta.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package intake diff --git a/services/intake/model_dremio_auth_test.go b/services/intake/model_dremio_auth_test.go new file mode 100644 index 000000000..7a79462aa --- /dev/null +++ b/services/intake/model_dremio_auth_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Intake API + +This API provides endpoints for managing Intakes. + +API version: 1beta.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package intake diff --git a/services/intake/model_intake_catalog.go b/services/intake/model_intake_catalog.go new file mode 100644 index 000000000..acfcf7592 --- /dev/null +++ b/services/intake/model_intake_catalog.go @@ -0,0 +1,367 @@ +/* +STACKIT Intake API + +This API provides endpoints for managing Intakes. + +API version: 1beta.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package intake + +import ( + "encoding/json" +) + +// checks if the IntakeCatalog type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IntakeCatalog{} + +/* + types and functions for auth +*/ + +// isModel +type IntakeCatalogGetAuthAttributeType = *CatalogAuth +type IntakeCatalogGetAuthArgType = CatalogAuth +type IntakeCatalogGetAuthRetType = CatalogAuth + +func getIntakeCatalogGetAuthAttributeTypeOk(arg IntakeCatalogGetAuthAttributeType) (ret IntakeCatalogGetAuthRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setIntakeCatalogGetAuthAttributeType(arg *IntakeCatalogGetAuthAttributeType, val IntakeCatalogGetAuthRetType) { + *arg = &val +} + +/* + types and functions for namespace +*/ + +// isNotNullableString +type IntakeCatalogGetNamespaceAttributeType = *string + +func getIntakeCatalogGetNamespaceAttributeTypeOk(arg IntakeCatalogGetNamespaceAttributeType) (ret IntakeCatalogGetNamespaceRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setIntakeCatalogGetNamespaceAttributeType(arg *IntakeCatalogGetNamespaceAttributeType, val IntakeCatalogGetNamespaceRetType) { + *arg = &val +} + +type IntakeCatalogGetNamespaceArgType = string +type IntakeCatalogGetNamespaceRetType = string + +/* + types and functions for partitionBy +*/ + +// isArray +type IntakeCatalogGetPartitionByAttributeType = *[]string +type IntakeCatalogGetPartitionByArgType = *[]string +type IntakeCatalogGetPartitionByRetType = *[]string + +func getIntakeCatalogGetPartitionByAttributeTypeOk(arg IntakeCatalogGetPartitionByAttributeType) (ret IntakeCatalogGetPartitionByRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg, true +} + +func setIntakeCatalogGetPartitionByAttributeType(arg *IntakeCatalogGetPartitionByAttributeType, val IntakeCatalogGetPartitionByRetType) { + *arg = val +} + +/* + types and functions for tableName +*/ + +// isNotNullableString +type IntakeCatalogGetTableNameAttributeType = *string + +func getIntakeCatalogGetTableNameAttributeTypeOk(arg IntakeCatalogGetTableNameAttributeType) (ret IntakeCatalogGetTableNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setIntakeCatalogGetTableNameAttributeType(arg *IntakeCatalogGetTableNameAttributeType, val IntakeCatalogGetTableNameRetType) { + *arg = &val +} + +type IntakeCatalogGetTableNameArgType = string +type IntakeCatalogGetTableNameRetType = string + +/* + types and functions for uri +*/ + +// isNotNullableString +type IntakeCatalogGetUriAttributeType = *string + +func getIntakeCatalogGetUriAttributeTypeOk(arg IntakeCatalogGetUriAttributeType) (ret IntakeCatalogGetUriRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setIntakeCatalogGetUriAttributeType(arg *IntakeCatalogGetUriAttributeType, val IntakeCatalogGetUriRetType) { + *arg = &val +} + +type IntakeCatalogGetUriArgType = string +type IntakeCatalogGetUriRetType = string + +/* + types and functions for warehouse +*/ + +// isNotNullableString +type IntakeCatalogGetWarehouseAttributeType = *string + +func getIntakeCatalogGetWarehouseAttributeTypeOk(arg IntakeCatalogGetWarehouseAttributeType) (ret IntakeCatalogGetWarehouseRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setIntakeCatalogGetWarehouseAttributeType(arg *IntakeCatalogGetWarehouseAttributeType, val IntakeCatalogGetWarehouseRetType) { + *arg = &val +} + +type IntakeCatalogGetWarehouseArgType = string +type IntakeCatalogGetWarehouseRetType = string + +// IntakeCatalog The Iceberg catalog configuration +type IntakeCatalog struct { + Auth IntakeCatalogGetAuthAttributeType `json:"auth,omitempty"` + // The namespace to which data shall be written. It will be automatically created, if it does not exist. + Namespace IntakeCatalogGetNamespaceAttributeType `json:"namespace,omitempty"` + PartitionBy IntakeCatalogGetPartitionByAttributeType `json:"partitionBy,omitempty"` + // The table name is a short name chosen by the user to identify the table in Iceberg. + TableName IntakeCatalogGetTableNameAttributeType `json:"tableName,omitempty"` + // The URI to the Iceberg catalog endpoint + // REQUIRED + Uri IntakeCatalogGetUriAttributeType `json:"uri" required:"true"` + // The Iceberg warehouse to connect to, required when the catalog has no default warehouse configured. + // REQUIRED + Warehouse IntakeCatalogGetWarehouseAttributeType `json:"warehouse" required:"true"` +} + +type _IntakeCatalog IntakeCatalog + +// NewIntakeCatalog instantiates a new IntakeCatalog 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 NewIntakeCatalog(uri IntakeCatalogGetUriArgType, warehouse IntakeCatalogGetWarehouseArgType) *IntakeCatalog { + this := IntakeCatalog{} + setIntakeCatalogGetUriAttributeType(&this.Uri, uri) + setIntakeCatalogGetWarehouseAttributeType(&this.Warehouse, warehouse) + return &this +} + +// NewIntakeCatalogWithDefaults instantiates a new IntakeCatalog 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 NewIntakeCatalogWithDefaults() *IntakeCatalog { + this := IntakeCatalog{} + var namespace string = "intake" + this.Namespace = &namespace + return &this +} + +// GetAuth returns the Auth field value if set, zero value otherwise. +func (o *IntakeCatalog) GetAuth() (res IntakeCatalogGetAuthRetType) { + res, _ = o.GetAuthOk() + return +} + +// GetAuthOk returns a tuple with the Auth field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IntakeCatalog) GetAuthOk() (ret IntakeCatalogGetAuthRetType, ok bool) { + return getIntakeCatalogGetAuthAttributeTypeOk(o.Auth) +} + +// HasAuth returns a boolean if a field has been set. +func (o *IntakeCatalog) HasAuth() bool { + _, ok := o.GetAuthOk() + return ok +} + +// SetAuth gets a reference to the given CatalogAuth and assigns it to the Auth field. +func (o *IntakeCatalog) SetAuth(v IntakeCatalogGetAuthRetType) { + setIntakeCatalogGetAuthAttributeType(&o.Auth, v) +} + +// GetNamespace returns the Namespace field value if set, zero value otherwise. +func (o *IntakeCatalog) GetNamespace() (res IntakeCatalogGetNamespaceRetType) { + res, _ = o.GetNamespaceOk() + return +} + +// GetNamespaceOk returns a tuple with the Namespace field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IntakeCatalog) GetNamespaceOk() (ret IntakeCatalogGetNamespaceRetType, ok bool) { + return getIntakeCatalogGetNamespaceAttributeTypeOk(o.Namespace) +} + +// HasNamespace returns a boolean if a field has been set. +func (o *IntakeCatalog) HasNamespace() bool { + _, ok := o.GetNamespaceOk() + return ok +} + +// SetNamespace gets a reference to the given string and assigns it to the Namespace field. +func (o *IntakeCatalog) SetNamespace(v IntakeCatalogGetNamespaceRetType) { + setIntakeCatalogGetNamespaceAttributeType(&o.Namespace, v) +} + +// GetPartitionBy returns the PartitionBy field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *IntakeCatalog) GetPartitionBy() (res IntakeCatalogGetPartitionByRetType) { + res, _ = o.GetPartitionByOk() + return +} + +// GetPartitionByOk returns a tuple with the PartitionBy field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IntakeCatalog) GetPartitionByOk() (ret IntakeCatalogGetPartitionByRetType, ok bool) { + return getIntakeCatalogGetPartitionByAttributeTypeOk(o.PartitionBy) +} + +// HasPartitionBy returns a boolean if a field has been set. +func (o *IntakeCatalog) HasPartitionBy() bool { + _, ok := o.GetPartitionByOk() + return ok +} + +// SetPartitionBy gets a reference to the given []string and assigns it to the PartitionBy field. +func (o *IntakeCatalog) SetPartitionBy(v IntakeCatalogGetPartitionByRetType) { + setIntakeCatalogGetPartitionByAttributeType(&o.PartitionBy, v) +} + +// GetTableName returns the TableName field value if set, zero value otherwise. +func (o *IntakeCatalog) GetTableName() (res IntakeCatalogGetTableNameRetType) { + res, _ = o.GetTableNameOk() + return +} + +// GetTableNameOk returns a tuple with the TableName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IntakeCatalog) GetTableNameOk() (ret IntakeCatalogGetTableNameRetType, ok bool) { + return getIntakeCatalogGetTableNameAttributeTypeOk(o.TableName) +} + +// HasTableName returns a boolean if a field has been set. +func (o *IntakeCatalog) HasTableName() bool { + _, ok := o.GetTableNameOk() + return ok +} + +// SetTableName gets a reference to the given string and assigns it to the TableName field. +func (o *IntakeCatalog) SetTableName(v IntakeCatalogGetTableNameRetType) { + setIntakeCatalogGetTableNameAttributeType(&o.TableName, v) +} + +// GetUri returns the Uri field value +func (o *IntakeCatalog) GetUri() (ret IntakeCatalogGetUriRetType) { + ret, _ = o.GetUriOk() + return ret +} + +// GetUriOk returns a tuple with the Uri field value +// and a boolean to check if the value has been set. +func (o *IntakeCatalog) GetUriOk() (ret IntakeCatalogGetUriRetType, ok bool) { + return getIntakeCatalogGetUriAttributeTypeOk(o.Uri) +} + +// SetUri sets field value +func (o *IntakeCatalog) SetUri(v IntakeCatalogGetUriRetType) { + setIntakeCatalogGetUriAttributeType(&o.Uri, v) +} + +// GetWarehouse returns the Warehouse field value +func (o *IntakeCatalog) GetWarehouse() (ret IntakeCatalogGetWarehouseRetType) { + ret, _ = o.GetWarehouseOk() + return ret +} + +// GetWarehouseOk returns a tuple with the Warehouse field value +// and a boolean to check if the value has been set. +func (o *IntakeCatalog) GetWarehouseOk() (ret IntakeCatalogGetWarehouseRetType, ok bool) { + return getIntakeCatalogGetWarehouseAttributeTypeOk(o.Warehouse) +} + +// SetWarehouse sets field value +func (o *IntakeCatalog) SetWarehouse(v IntakeCatalogGetWarehouseRetType) { + setIntakeCatalogGetWarehouseAttributeType(&o.Warehouse, v) +} + +func (o IntakeCatalog) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getIntakeCatalogGetAuthAttributeTypeOk(o.Auth); ok { + toSerialize["Auth"] = val + } + if val, ok := getIntakeCatalogGetNamespaceAttributeTypeOk(o.Namespace); ok { + toSerialize["Namespace"] = val + } + if val, ok := getIntakeCatalogGetPartitionByAttributeTypeOk(o.PartitionBy); ok { + toSerialize["PartitionBy"] = val + } + if val, ok := getIntakeCatalogGetTableNameAttributeTypeOk(o.TableName); ok { + toSerialize["TableName"] = val + } + if val, ok := getIntakeCatalogGetUriAttributeTypeOk(o.Uri); ok { + toSerialize["Uri"] = val + } + if val, ok := getIntakeCatalogGetWarehouseAttributeTypeOk(o.Warehouse); ok { + toSerialize["Warehouse"] = val + } + return toSerialize, nil +} + +type NullableIntakeCatalog struct { + value *IntakeCatalog + isSet bool +} + +func (v NullableIntakeCatalog) Get() *IntakeCatalog { + return v.value +} + +func (v *NullableIntakeCatalog) Set(val *IntakeCatalog) { + v.value = val + v.isSet = true +} + +func (v NullableIntakeCatalog) IsSet() bool { + return v.isSet +} + +func (v *NullableIntakeCatalog) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIntakeCatalog(val *IntakeCatalog) *NullableIntakeCatalog { + return &NullableIntakeCatalog{value: val, isSet: true} +} + +func (v NullableIntakeCatalog) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIntakeCatalog) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/intake/model_intake_catalog_patch.go b/services/intake/model_intake_catalog_patch.go new file mode 100644 index 000000000..15811a59c --- /dev/null +++ b/services/intake/model_intake_catalog_patch.go @@ -0,0 +1,325 @@ +/* +STACKIT Intake API + +This API provides endpoints for managing Intakes. + +API version: 1beta.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package intake + +import ( + "encoding/json" +) + +// checks if the IntakeCatalogPatch type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IntakeCatalogPatch{} + +/* + types and functions for auth +*/ + +// isModel +type IntakeCatalogPatchGetAuthAttributeType = *CatalogAuthPatch +type IntakeCatalogPatchGetAuthArgType = CatalogAuthPatch +type IntakeCatalogPatchGetAuthRetType = CatalogAuthPatch + +func getIntakeCatalogPatchGetAuthAttributeTypeOk(arg IntakeCatalogPatchGetAuthAttributeType) (ret IntakeCatalogPatchGetAuthRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setIntakeCatalogPatchGetAuthAttributeType(arg *IntakeCatalogPatchGetAuthAttributeType, val IntakeCatalogPatchGetAuthRetType) { + *arg = &val +} + +/* + types and functions for namespace +*/ + +// isNotNullableString +type IntakeCatalogPatchGetNamespaceAttributeType = *string + +func getIntakeCatalogPatchGetNamespaceAttributeTypeOk(arg IntakeCatalogPatchGetNamespaceAttributeType) (ret IntakeCatalogPatchGetNamespaceRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setIntakeCatalogPatchGetNamespaceAttributeType(arg *IntakeCatalogPatchGetNamespaceAttributeType, val IntakeCatalogPatchGetNamespaceRetType) { + *arg = &val +} + +type IntakeCatalogPatchGetNamespaceArgType = string +type IntakeCatalogPatchGetNamespaceRetType = string + +/* + types and functions for tableName +*/ + +// isNotNullableString +type IntakeCatalogPatchGetTableNameAttributeType = *string + +func getIntakeCatalogPatchGetTableNameAttributeTypeOk(arg IntakeCatalogPatchGetTableNameAttributeType) (ret IntakeCatalogPatchGetTableNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setIntakeCatalogPatchGetTableNameAttributeType(arg *IntakeCatalogPatchGetTableNameAttributeType, val IntakeCatalogPatchGetTableNameRetType) { + *arg = &val +} + +type IntakeCatalogPatchGetTableNameArgType = string +type IntakeCatalogPatchGetTableNameRetType = string + +/* + types and functions for uri +*/ + +// isNotNullableString +type IntakeCatalogPatchGetUriAttributeType = *string + +func getIntakeCatalogPatchGetUriAttributeTypeOk(arg IntakeCatalogPatchGetUriAttributeType) (ret IntakeCatalogPatchGetUriRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setIntakeCatalogPatchGetUriAttributeType(arg *IntakeCatalogPatchGetUriAttributeType, val IntakeCatalogPatchGetUriRetType) { + *arg = &val +} + +type IntakeCatalogPatchGetUriArgType = string +type IntakeCatalogPatchGetUriRetType = string + +/* + types and functions for warehouse +*/ + +// isNotNullableString +type IntakeCatalogPatchGetWarehouseAttributeType = *string + +func getIntakeCatalogPatchGetWarehouseAttributeTypeOk(arg IntakeCatalogPatchGetWarehouseAttributeType) (ret IntakeCatalogPatchGetWarehouseRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setIntakeCatalogPatchGetWarehouseAttributeType(arg *IntakeCatalogPatchGetWarehouseAttributeType, val IntakeCatalogPatchGetWarehouseRetType) { + *arg = &val +} + +type IntakeCatalogPatchGetWarehouseArgType = string +type IntakeCatalogPatchGetWarehouseRetType = string + +// IntakeCatalogPatch The Iceberg catalog configuration +type IntakeCatalogPatch struct { + Auth IntakeCatalogPatchGetAuthAttributeType `json:"auth,omitempty"` + // The namespace to which data shall be written. It will be automatically created, if it does not exist. + Namespace IntakeCatalogPatchGetNamespaceAttributeType `json:"namespace,omitempty"` + // The table name is a short name chosen by the user to identify the table in Iceberg. + TableName IntakeCatalogPatchGetTableNameAttributeType `json:"tableName,omitempty"` + // The URI to the Iceberg catalog endpoint + Uri IntakeCatalogPatchGetUriAttributeType `json:"uri,omitempty"` + // The Iceberg warehouse to connect to, required when the catalog has no default warehouse configured. + Warehouse IntakeCatalogPatchGetWarehouseAttributeType `json:"warehouse,omitempty"` +} + +// NewIntakeCatalogPatch instantiates a new IntakeCatalogPatch 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 NewIntakeCatalogPatch() *IntakeCatalogPatch { + this := IntakeCatalogPatch{} + return &this +} + +// NewIntakeCatalogPatchWithDefaults instantiates a new IntakeCatalogPatch 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 NewIntakeCatalogPatchWithDefaults() *IntakeCatalogPatch { + this := IntakeCatalogPatch{} + var namespace string = "intake" + this.Namespace = &namespace + return &this +} + +// GetAuth returns the Auth field value if set, zero value otherwise. +func (o *IntakeCatalogPatch) GetAuth() (res IntakeCatalogPatchGetAuthRetType) { + res, _ = o.GetAuthOk() + return +} + +// GetAuthOk returns a tuple with the Auth field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IntakeCatalogPatch) GetAuthOk() (ret IntakeCatalogPatchGetAuthRetType, ok bool) { + return getIntakeCatalogPatchGetAuthAttributeTypeOk(o.Auth) +} + +// HasAuth returns a boolean if a field has been set. +func (o *IntakeCatalogPatch) HasAuth() bool { + _, ok := o.GetAuthOk() + return ok +} + +// SetAuth gets a reference to the given CatalogAuthPatch and assigns it to the Auth field. +func (o *IntakeCatalogPatch) SetAuth(v IntakeCatalogPatchGetAuthRetType) { + setIntakeCatalogPatchGetAuthAttributeType(&o.Auth, v) +} + +// GetNamespace returns the Namespace field value if set, zero value otherwise. +func (o *IntakeCatalogPatch) GetNamespace() (res IntakeCatalogPatchGetNamespaceRetType) { + res, _ = o.GetNamespaceOk() + return +} + +// GetNamespaceOk returns a tuple with the Namespace field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IntakeCatalogPatch) GetNamespaceOk() (ret IntakeCatalogPatchGetNamespaceRetType, ok bool) { + return getIntakeCatalogPatchGetNamespaceAttributeTypeOk(o.Namespace) +} + +// HasNamespace returns a boolean if a field has been set. +func (o *IntakeCatalogPatch) HasNamespace() bool { + _, ok := o.GetNamespaceOk() + return ok +} + +// SetNamespace gets a reference to the given string and assigns it to the Namespace field. +func (o *IntakeCatalogPatch) SetNamespace(v IntakeCatalogPatchGetNamespaceRetType) { + setIntakeCatalogPatchGetNamespaceAttributeType(&o.Namespace, v) +} + +// GetTableName returns the TableName field value if set, zero value otherwise. +func (o *IntakeCatalogPatch) GetTableName() (res IntakeCatalogPatchGetTableNameRetType) { + res, _ = o.GetTableNameOk() + return +} + +// GetTableNameOk returns a tuple with the TableName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IntakeCatalogPatch) GetTableNameOk() (ret IntakeCatalogPatchGetTableNameRetType, ok bool) { + return getIntakeCatalogPatchGetTableNameAttributeTypeOk(o.TableName) +} + +// HasTableName returns a boolean if a field has been set. +func (o *IntakeCatalogPatch) HasTableName() bool { + _, ok := o.GetTableNameOk() + return ok +} + +// SetTableName gets a reference to the given string and assigns it to the TableName field. +func (o *IntakeCatalogPatch) SetTableName(v IntakeCatalogPatchGetTableNameRetType) { + setIntakeCatalogPatchGetTableNameAttributeType(&o.TableName, v) +} + +// GetUri returns the Uri field value if set, zero value otherwise. +func (o *IntakeCatalogPatch) GetUri() (res IntakeCatalogPatchGetUriRetType) { + res, _ = o.GetUriOk() + return +} + +// GetUriOk returns a tuple with the Uri field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IntakeCatalogPatch) GetUriOk() (ret IntakeCatalogPatchGetUriRetType, ok bool) { + return getIntakeCatalogPatchGetUriAttributeTypeOk(o.Uri) +} + +// HasUri returns a boolean if a field has been set. +func (o *IntakeCatalogPatch) HasUri() bool { + _, ok := o.GetUriOk() + return ok +} + +// SetUri gets a reference to the given string and assigns it to the Uri field. +func (o *IntakeCatalogPatch) SetUri(v IntakeCatalogPatchGetUriRetType) { + setIntakeCatalogPatchGetUriAttributeType(&o.Uri, v) +} + +// GetWarehouse returns the Warehouse field value if set, zero value otherwise. +func (o *IntakeCatalogPatch) GetWarehouse() (res IntakeCatalogPatchGetWarehouseRetType) { + res, _ = o.GetWarehouseOk() + return +} + +// GetWarehouseOk returns a tuple with the Warehouse field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IntakeCatalogPatch) GetWarehouseOk() (ret IntakeCatalogPatchGetWarehouseRetType, ok bool) { + return getIntakeCatalogPatchGetWarehouseAttributeTypeOk(o.Warehouse) +} + +// HasWarehouse returns a boolean if a field has been set. +func (o *IntakeCatalogPatch) HasWarehouse() bool { + _, ok := o.GetWarehouseOk() + return ok +} + +// SetWarehouse gets a reference to the given string and assigns it to the Warehouse field. +func (o *IntakeCatalogPatch) SetWarehouse(v IntakeCatalogPatchGetWarehouseRetType) { + setIntakeCatalogPatchGetWarehouseAttributeType(&o.Warehouse, v) +} + +func (o IntakeCatalogPatch) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getIntakeCatalogPatchGetAuthAttributeTypeOk(o.Auth); ok { + toSerialize["Auth"] = val + } + if val, ok := getIntakeCatalogPatchGetNamespaceAttributeTypeOk(o.Namespace); ok { + toSerialize["Namespace"] = val + } + if val, ok := getIntakeCatalogPatchGetTableNameAttributeTypeOk(o.TableName); ok { + toSerialize["TableName"] = val + } + if val, ok := getIntakeCatalogPatchGetUriAttributeTypeOk(o.Uri); ok { + toSerialize["Uri"] = val + } + if val, ok := getIntakeCatalogPatchGetWarehouseAttributeTypeOk(o.Warehouse); ok { + toSerialize["Warehouse"] = val + } + return toSerialize, nil +} + +type NullableIntakeCatalogPatch struct { + value *IntakeCatalogPatch + isSet bool +} + +func (v NullableIntakeCatalogPatch) Get() *IntakeCatalogPatch { + return v.value +} + +func (v *NullableIntakeCatalogPatch) Set(val *IntakeCatalogPatch) { + v.value = val + v.isSet = true +} + +func (v NullableIntakeCatalogPatch) IsSet() bool { + return v.isSet +} + +func (v *NullableIntakeCatalogPatch) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIntakeCatalogPatch(val *IntakeCatalogPatch) *NullableIntakeCatalogPatch { + return &NullableIntakeCatalogPatch{value: val, isSet: true} +} + +func (v NullableIntakeCatalogPatch) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIntakeCatalogPatch) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/intake/model_intake_catalog_patch_test.go b/services/intake/model_intake_catalog_patch_test.go new file mode 100644 index 000000000..7a79462aa --- /dev/null +++ b/services/intake/model_intake_catalog_patch_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Intake API + +This API provides endpoints for managing Intakes. + +API version: 1beta.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package intake diff --git a/services/intake/model_intake_catalog_test.go b/services/intake/model_intake_catalog_test.go new file mode 100644 index 000000000..7a79462aa --- /dev/null +++ b/services/intake/model_intake_catalog_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Intake API + +This API provides endpoints for managing Intakes. + +API version: 1beta.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package intake diff --git a/services/intake/model_intake_response.go b/services/intake/model_intake_response.go new file mode 100644 index 000000000..ae61a0b63 --- /dev/null +++ b/services/intake/model_intake_response.go @@ -0,0 +1,788 @@ +/* +STACKIT Intake API + +This API provides endpoints for managing Intakes. + +API version: 1beta.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package intake + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the IntakeResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IntakeResponse{} + +/* + types and functions for catalog +*/ + +// isModel +type IntakeResponseGetCatalogAttributeType = *IntakeCatalog +type IntakeResponseGetCatalogArgType = IntakeCatalog +type IntakeResponseGetCatalogRetType = IntakeCatalog + +func getIntakeResponseGetCatalogAttributeTypeOk(arg IntakeResponseGetCatalogAttributeType) (ret IntakeResponseGetCatalogRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setIntakeResponseGetCatalogAttributeType(arg *IntakeResponseGetCatalogAttributeType, val IntakeResponseGetCatalogRetType) { + *arg = &val +} + +/* + types and functions for create_time +*/ + +// isDateTime +type IntakeResponseGetCreateTimeAttributeType = *time.Time +type IntakeResponseGetCreateTimeArgType = time.Time +type IntakeResponseGetCreateTimeRetType = time.Time + +func getIntakeResponseGetCreateTimeAttributeTypeOk(arg IntakeResponseGetCreateTimeAttributeType) (ret IntakeResponseGetCreateTimeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setIntakeResponseGetCreateTimeAttributeType(arg *IntakeResponseGetCreateTimeAttributeType, val IntakeResponseGetCreateTimeRetType) { + *arg = &val +} + +/* + types and functions for deadLetterTopic +*/ + +// isNotNullableString +type IntakeResponseGetDeadLetterTopicAttributeType = *string + +func getIntakeResponseGetDeadLetterTopicAttributeTypeOk(arg IntakeResponseGetDeadLetterTopicAttributeType) (ret IntakeResponseGetDeadLetterTopicRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setIntakeResponseGetDeadLetterTopicAttributeType(arg *IntakeResponseGetDeadLetterTopicAttributeType, val IntakeResponseGetDeadLetterTopicRetType) { + *arg = &val +} + +type IntakeResponseGetDeadLetterTopicArgType = string +type IntakeResponseGetDeadLetterTopicRetType = string + +/* + types and functions for description +*/ + +// isNotNullableString +type IntakeResponseGetDescriptionAttributeType = *string + +func getIntakeResponseGetDescriptionAttributeTypeOk(arg IntakeResponseGetDescriptionAttributeType) (ret IntakeResponseGetDescriptionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setIntakeResponseGetDescriptionAttributeType(arg *IntakeResponseGetDescriptionAttributeType, val IntakeResponseGetDescriptionRetType) { + *arg = &val +} + +type IntakeResponseGetDescriptionArgType = string +type IntakeResponseGetDescriptionRetType = string + +/* + types and functions for displayName +*/ + +// isNotNullableString +type IntakeResponseGetDisplayNameAttributeType = *string + +func getIntakeResponseGetDisplayNameAttributeTypeOk(arg IntakeResponseGetDisplayNameAttributeType) (ret IntakeResponseGetDisplayNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setIntakeResponseGetDisplayNameAttributeType(arg *IntakeResponseGetDisplayNameAttributeType, val IntakeResponseGetDisplayNameRetType) { + *arg = &val +} + +type IntakeResponseGetDisplayNameArgType = string +type IntakeResponseGetDisplayNameRetType = string + +/* + types and functions for failure_message +*/ + +// isNotNullableString +type IntakeResponseGetFailureMessageAttributeType = *string + +func getIntakeResponseGetFailureMessageAttributeTypeOk(arg IntakeResponseGetFailureMessageAttributeType) (ret IntakeResponseGetFailureMessageRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setIntakeResponseGetFailureMessageAttributeType(arg *IntakeResponseGetFailureMessageAttributeType, val IntakeResponseGetFailureMessageRetType) { + *arg = &val +} + +type IntakeResponseGetFailureMessageArgType = string +type IntakeResponseGetFailureMessageRetType = string + +/* + types and functions for id +*/ + +// isNotNullableString +type IntakeResponseGetIdAttributeType = *string + +func getIntakeResponseGetIdAttributeTypeOk(arg IntakeResponseGetIdAttributeType) (ret IntakeResponseGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setIntakeResponseGetIdAttributeType(arg *IntakeResponseGetIdAttributeType, val IntakeResponseGetIdRetType) { + *arg = &val +} + +type IntakeResponseGetIdArgType = string +type IntakeResponseGetIdRetType = string + +/* + types and functions for intakeRunnerId +*/ + +// isNotNullableString +type IntakeResponseGetIntakeRunnerIdAttributeType = *string + +func getIntakeResponseGetIntakeRunnerIdAttributeTypeOk(arg IntakeResponseGetIntakeRunnerIdAttributeType) (ret IntakeResponseGetIntakeRunnerIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setIntakeResponseGetIntakeRunnerIdAttributeType(arg *IntakeResponseGetIntakeRunnerIdAttributeType, val IntakeResponseGetIntakeRunnerIdRetType) { + *arg = &val +} + +type IntakeResponseGetIntakeRunnerIdArgType = string +type IntakeResponseGetIntakeRunnerIdRetType = string + +/* + types and functions for labels +*/ + +// isContainer +type IntakeResponseGetLabelsAttributeType = *map[string]string +type IntakeResponseGetLabelsArgType = *map[string]string +type IntakeResponseGetLabelsRetType = *map[string]string + +func getIntakeResponseGetLabelsAttributeTypeOk(arg IntakeResponseGetLabelsAttributeType) (ret IntakeResponseGetLabelsRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg, true +} + +func setIntakeResponseGetLabelsAttributeType(arg *IntakeResponseGetLabelsAttributeType, val IntakeResponseGetLabelsRetType) { + *arg = val +} + +/* + types and functions for state +*/ + +// isEnum + +// IntakeResponseState The current state of the resource. +// value type for enums +type IntakeResponseState string + +// List of State +const ( + INTAKERESPONSESTATE_RECONCILING IntakeResponseState = "reconciling" + INTAKERESPONSESTATE_ACTIVE IntakeResponseState = "active" + INTAKERESPONSESTATE_DELETING IntakeResponseState = "deleting" + INTAKERESPONSESTATE_FAILED IntakeResponseState = "failed" +) + +// All allowed values of IntakeResponse enum +var AllowedIntakeResponseStateEnumValues = []IntakeResponseState{ + "reconciling", + "active", + "deleting", + "failed", +} + +func (v *IntakeResponseState) UnmarshalJSON(src []byte) error { + // use a type alias to prevent infinite recursion during unmarshal, + // see https://biscuit.ninja/posts/go-avoid-an-infitine-loop-with-custom-json-unmarshallers + type TmpJson IntakeResponseState + var value TmpJson + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + // Allow unmarshalling zero value for testing purposes + var zeroValue TmpJson + if value == zeroValue { + return nil + } + enumTypeValue := IntakeResponseState(value) + for _, existing := range AllowedIntakeResponseStateEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid IntakeResponse", value) +} + +// NewIntakeResponseStateFromValue returns a pointer to a valid IntakeResponseState +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewIntakeResponseStateFromValue(v IntakeResponseState) (*IntakeResponseState, error) { + ev := IntakeResponseState(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for IntakeResponseState: valid values are %v", v, AllowedIntakeResponseStateEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v IntakeResponseState) IsValid() bool { + for _, existing := range AllowedIntakeResponseStateEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to StateState value +func (v IntakeResponseState) Ptr() *IntakeResponseState { + return &v +} + +type NullableIntakeResponseState struct { + value *IntakeResponseState + isSet bool +} + +func (v NullableIntakeResponseState) Get() *IntakeResponseState { + return v.value +} + +func (v *NullableIntakeResponseState) Set(val *IntakeResponseState) { + v.value = val + v.isSet = true +} + +func (v NullableIntakeResponseState) IsSet() bool { + return v.isSet +} + +func (v *NullableIntakeResponseState) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIntakeResponseState(val *IntakeResponseState) *NullableIntakeResponseState { + return &NullableIntakeResponseState{value: val, isSet: true} +} + +func (v NullableIntakeResponseState) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIntakeResponseState) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type IntakeResponseGetStateAttributeType = *IntakeResponseState +type IntakeResponseGetStateArgType = IntakeResponseState +type IntakeResponseGetStateRetType = IntakeResponseState + +func getIntakeResponseGetStateAttributeTypeOk(arg IntakeResponseGetStateAttributeType) (ret IntakeResponseGetStateRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setIntakeResponseGetStateAttributeType(arg *IntakeResponseGetStateAttributeType, val IntakeResponseGetStateRetType) { + *arg = &val +} + +/* + types and functions for topic +*/ + +// isNotNullableString +type IntakeResponseGetTopicAttributeType = *string + +func getIntakeResponseGetTopicAttributeTypeOk(arg IntakeResponseGetTopicAttributeType) (ret IntakeResponseGetTopicRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setIntakeResponseGetTopicAttributeType(arg *IntakeResponseGetTopicAttributeType, val IntakeResponseGetTopicRetType) { + *arg = &val +} + +type IntakeResponseGetTopicArgType = string +type IntakeResponseGetTopicRetType = string + +/* + types and functions for undeliveredMessageCount +*/ + +// isLong +type IntakeResponseGetUndeliveredMessageCountAttributeType = *int64 +type IntakeResponseGetUndeliveredMessageCountArgType = int64 +type IntakeResponseGetUndeliveredMessageCountRetType = int64 + +func getIntakeResponseGetUndeliveredMessageCountAttributeTypeOk(arg IntakeResponseGetUndeliveredMessageCountAttributeType) (ret IntakeResponseGetUndeliveredMessageCountRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setIntakeResponseGetUndeliveredMessageCountAttributeType(arg *IntakeResponseGetUndeliveredMessageCountAttributeType, val IntakeResponseGetUndeliveredMessageCountRetType) { + *arg = &val +} + +/* + types and functions for uri +*/ + +// isNotNullableString +type IntakeResponseGetUriAttributeType = *string + +func getIntakeResponseGetUriAttributeTypeOk(arg IntakeResponseGetUriAttributeType) (ret IntakeResponseGetUriRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setIntakeResponseGetUriAttributeType(arg *IntakeResponseGetUriAttributeType, val IntakeResponseGetUriRetType) { + *arg = &val +} + +type IntakeResponseGetUriArgType = string +type IntakeResponseGetUriRetType = string + +// IntakeResponse struct for IntakeResponse +type IntakeResponse struct { + // REQUIRED + Catalog IntakeResponseGetCatalogAttributeType `json:"catalog" required:"true"` + // The point in time the resource was created. + // REQUIRED + CreateTime IntakeResponseGetCreateTimeAttributeType `json:"create_time" required:"true"` + // The topic where undelivered messages are published (Dead Letter Queue). + // REQUIRED + DeadLetterTopic IntakeResponseGetDeadLetterTopicAttributeType `json:"deadLetterTopic" required:"true"` + // The description is a longer text chosen by the user to provide more context for the resource. + Description IntakeResponseGetDescriptionAttributeType `json:"description,omitempty"` + // The display name is a short name chosen by the user to identify the resource. + // REQUIRED + DisplayName IntakeResponseGetDisplayNameAttributeType `json:"displayName" required:"true"` + // A human-readable description of the error, if the state is 'failed'. + FailureMessage IntakeResponseGetFailureMessageAttributeType `json:"failure_message,omitempty"` + // A auto generated unique id which identifies the resource. + // REQUIRED + Id IntakeResponseGetIdAttributeType `json:"id" required:"true"` + // The unique id of the intake runner this intake is running on. + // REQUIRED + IntakeRunnerId IntakeResponseGetIntakeRunnerIdAttributeType `json:"intakeRunnerId" required:"true"` + // Labels are a set of key-value pairs assigned to resources. + Labels IntakeResponseGetLabelsAttributeType `json:"labels,omitempty"` + // The current state of the resource. + // REQUIRED + State IntakeResponseGetStateAttributeType `json:"state" required:"true"` + // The topic to publish data to. + // REQUIRED + Topic IntakeResponseGetTopicAttributeType `json:"topic" required:"true"` + // Number of messages that failed delivery and were sent to the Dead Letter Queue. + UndeliveredMessageCount IntakeResponseGetUndeliveredMessageCountAttributeType `json:"undeliveredMessageCount,omitempty"` + // The URI for reaching the resource. + // REQUIRED + Uri IntakeResponseGetUriAttributeType `json:"uri" required:"true"` +} + +type _IntakeResponse IntakeResponse + +// NewIntakeResponse instantiates a new IntakeResponse 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 NewIntakeResponse(catalog IntakeResponseGetCatalogArgType, createTime IntakeResponseGetCreateTimeArgType, deadLetterTopic IntakeResponseGetDeadLetterTopicArgType, displayName IntakeResponseGetDisplayNameArgType, id IntakeResponseGetIdArgType, intakeRunnerId IntakeResponseGetIntakeRunnerIdArgType, state IntakeResponseGetStateArgType, topic IntakeResponseGetTopicArgType, uri IntakeResponseGetUriArgType) *IntakeResponse { + this := IntakeResponse{} + setIntakeResponseGetCatalogAttributeType(&this.Catalog, catalog) + setIntakeResponseGetCreateTimeAttributeType(&this.CreateTime, createTime) + setIntakeResponseGetDeadLetterTopicAttributeType(&this.DeadLetterTopic, deadLetterTopic) + setIntakeResponseGetDisplayNameAttributeType(&this.DisplayName, displayName) + setIntakeResponseGetIdAttributeType(&this.Id, id) + setIntakeResponseGetIntakeRunnerIdAttributeType(&this.IntakeRunnerId, intakeRunnerId) + setIntakeResponseGetStateAttributeType(&this.State, state) + setIntakeResponseGetTopicAttributeType(&this.Topic, topic) + setIntakeResponseGetUriAttributeType(&this.Uri, uri) + return &this +} + +// NewIntakeResponseWithDefaults instantiates a new IntakeResponse 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 NewIntakeResponseWithDefaults() *IntakeResponse { + this := IntakeResponse{} + return &this +} + +// GetCatalog returns the Catalog field value +func (o *IntakeResponse) GetCatalog() (ret IntakeResponseGetCatalogRetType) { + ret, _ = o.GetCatalogOk() + return ret +} + +// GetCatalogOk returns a tuple with the Catalog field value +// and a boolean to check if the value has been set. +func (o *IntakeResponse) GetCatalogOk() (ret IntakeResponseGetCatalogRetType, ok bool) { + return getIntakeResponseGetCatalogAttributeTypeOk(o.Catalog) +} + +// SetCatalog sets field value +func (o *IntakeResponse) SetCatalog(v IntakeResponseGetCatalogRetType) { + setIntakeResponseGetCatalogAttributeType(&o.Catalog, v) +} + +// GetCreateTime returns the CreateTime field value +func (o *IntakeResponse) GetCreateTime() (ret IntakeResponseGetCreateTimeRetType) { + ret, _ = o.GetCreateTimeOk() + return ret +} + +// GetCreateTimeOk returns a tuple with the CreateTime field value +// and a boolean to check if the value has been set. +func (o *IntakeResponse) GetCreateTimeOk() (ret IntakeResponseGetCreateTimeRetType, ok bool) { + return getIntakeResponseGetCreateTimeAttributeTypeOk(o.CreateTime) +} + +// SetCreateTime sets field value +func (o *IntakeResponse) SetCreateTime(v IntakeResponseGetCreateTimeRetType) { + setIntakeResponseGetCreateTimeAttributeType(&o.CreateTime, v) +} + +// GetDeadLetterTopic returns the DeadLetterTopic field value +func (o *IntakeResponse) GetDeadLetterTopic() (ret IntakeResponseGetDeadLetterTopicRetType) { + ret, _ = o.GetDeadLetterTopicOk() + return ret +} + +// GetDeadLetterTopicOk returns a tuple with the DeadLetterTopic field value +// and a boolean to check if the value has been set. +func (o *IntakeResponse) GetDeadLetterTopicOk() (ret IntakeResponseGetDeadLetterTopicRetType, ok bool) { + return getIntakeResponseGetDeadLetterTopicAttributeTypeOk(o.DeadLetterTopic) +} + +// SetDeadLetterTopic sets field value +func (o *IntakeResponse) SetDeadLetterTopic(v IntakeResponseGetDeadLetterTopicRetType) { + setIntakeResponseGetDeadLetterTopicAttributeType(&o.DeadLetterTopic, v) +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *IntakeResponse) GetDescription() (res IntakeResponseGetDescriptionRetType) { + res, _ = o.GetDescriptionOk() + return +} + +// 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 *IntakeResponse) GetDescriptionOk() (ret IntakeResponseGetDescriptionRetType, ok bool) { + return getIntakeResponseGetDescriptionAttributeTypeOk(o.Description) +} + +// HasDescription returns a boolean if a field has been set. +func (o *IntakeResponse) HasDescription() bool { + _, ok := o.GetDescriptionOk() + return ok +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *IntakeResponse) SetDescription(v IntakeResponseGetDescriptionRetType) { + setIntakeResponseGetDescriptionAttributeType(&o.Description, v) +} + +// GetDisplayName returns the DisplayName field value +func (o *IntakeResponse) GetDisplayName() (ret IntakeResponseGetDisplayNameRetType) { + ret, _ = o.GetDisplayNameOk() + return ret +} + +// GetDisplayNameOk returns a tuple with the DisplayName field value +// and a boolean to check if the value has been set. +func (o *IntakeResponse) GetDisplayNameOk() (ret IntakeResponseGetDisplayNameRetType, ok bool) { + return getIntakeResponseGetDisplayNameAttributeTypeOk(o.DisplayName) +} + +// SetDisplayName sets field value +func (o *IntakeResponse) SetDisplayName(v IntakeResponseGetDisplayNameRetType) { + setIntakeResponseGetDisplayNameAttributeType(&o.DisplayName, v) +} + +// GetFailureMessage returns the FailureMessage field value if set, zero value otherwise. +func (o *IntakeResponse) GetFailureMessage() (res IntakeResponseGetFailureMessageRetType) { + res, _ = o.GetFailureMessageOk() + return +} + +// GetFailureMessageOk returns a tuple with the FailureMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IntakeResponse) GetFailureMessageOk() (ret IntakeResponseGetFailureMessageRetType, ok bool) { + return getIntakeResponseGetFailureMessageAttributeTypeOk(o.FailureMessage) +} + +// HasFailureMessage returns a boolean if a field has been set. +func (o *IntakeResponse) HasFailureMessage() bool { + _, ok := o.GetFailureMessageOk() + return ok +} + +// SetFailureMessage gets a reference to the given string and assigns it to the FailureMessage field. +func (o *IntakeResponse) SetFailureMessage(v IntakeResponseGetFailureMessageRetType) { + setIntakeResponseGetFailureMessageAttributeType(&o.FailureMessage, v) +} + +// GetId returns the Id field value +func (o *IntakeResponse) GetId() (ret IntakeResponseGetIdRetType) { + ret, _ = o.GetIdOk() + return ret +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *IntakeResponse) GetIdOk() (ret IntakeResponseGetIdRetType, ok bool) { + return getIntakeResponseGetIdAttributeTypeOk(o.Id) +} + +// SetId sets field value +func (o *IntakeResponse) SetId(v IntakeResponseGetIdRetType) { + setIntakeResponseGetIdAttributeType(&o.Id, v) +} + +// GetIntakeRunnerId returns the IntakeRunnerId field value +func (o *IntakeResponse) GetIntakeRunnerId() (ret IntakeResponseGetIntakeRunnerIdRetType) { + ret, _ = o.GetIntakeRunnerIdOk() + return ret +} + +// GetIntakeRunnerIdOk returns a tuple with the IntakeRunnerId field value +// and a boolean to check if the value has been set. +func (o *IntakeResponse) GetIntakeRunnerIdOk() (ret IntakeResponseGetIntakeRunnerIdRetType, ok bool) { + return getIntakeResponseGetIntakeRunnerIdAttributeTypeOk(o.IntakeRunnerId) +} + +// SetIntakeRunnerId sets field value +func (o *IntakeResponse) SetIntakeRunnerId(v IntakeResponseGetIntakeRunnerIdRetType) { + setIntakeResponseGetIntakeRunnerIdAttributeType(&o.IntakeRunnerId, v) +} + +// GetLabels returns the Labels field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *IntakeResponse) GetLabels() (res IntakeResponseGetLabelsRetType) { + res, _ = o.GetLabelsOk() + return +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IntakeResponse) GetLabelsOk() (ret IntakeResponseGetLabelsRetType, ok bool) { + return getIntakeResponseGetLabelsAttributeTypeOk(o.Labels) +} + +// HasLabels returns a boolean if a field has been set. +func (o *IntakeResponse) HasLabels() bool { + _, ok := o.GetLabelsOk() + return ok +} + +// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. +func (o *IntakeResponse) SetLabels(v IntakeResponseGetLabelsRetType) { + setIntakeResponseGetLabelsAttributeType(&o.Labels, v) +} + +// GetState returns the State field value +func (o *IntakeResponse) GetState() (ret IntakeResponseGetStateRetType) { + ret, _ = o.GetStateOk() + return ret +} + +// GetStateOk returns a tuple with the State field value +// and a boolean to check if the value has been set. +func (o *IntakeResponse) GetStateOk() (ret IntakeResponseGetStateRetType, ok bool) { + return getIntakeResponseGetStateAttributeTypeOk(o.State) +} + +// SetState sets field value +func (o *IntakeResponse) SetState(v IntakeResponseGetStateRetType) { + setIntakeResponseGetStateAttributeType(&o.State, v) +} + +// GetTopic returns the Topic field value +func (o *IntakeResponse) GetTopic() (ret IntakeResponseGetTopicRetType) { + ret, _ = o.GetTopicOk() + return ret +} + +// GetTopicOk returns a tuple with the Topic field value +// and a boolean to check if the value has been set. +func (o *IntakeResponse) GetTopicOk() (ret IntakeResponseGetTopicRetType, ok bool) { + return getIntakeResponseGetTopicAttributeTypeOk(o.Topic) +} + +// SetTopic sets field value +func (o *IntakeResponse) SetTopic(v IntakeResponseGetTopicRetType) { + setIntakeResponseGetTopicAttributeType(&o.Topic, v) +} + +// GetUndeliveredMessageCount returns the UndeliveredMessageCount field value if set, zero value otherwise. +func (o *IntakeResponse) GetUndeliveredMessageCount() (res IntakeResponseGetUndeliveredMessageCountRetType) { + res, _ = o.GetUndeliveredMessageCountOk() + return +} + +// GetUndeliveredMessageCountOk returns a tuple with the UndeliveredMessageCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IntakeResponse) GetUndeliveredMessageCountOk() (ret IntakeResponseGetUndeliveredMessageCountRetType, ok bool) { + return getIntakeResponseGetUndeliveredMessageCountAttributeTypeOk(o.UndeliveredMessageCount) +} + +// HasUndeliveredMessageCount returns a boolean if a field has been set. +func (o *IntakeResponse) HasUndeliveredMessageCount() bool { + _, ok := o.GetUndeliveredMessageCountOk() + return ok +} + +// SetUndeliveredMessageCount gets a reference to the given int64 and assigns it to the UndeliveredMessageCount field. +func (o *IntakeResponse) SetUndeliveredMessageCount(v IntakeResponseGetUndeliveredMessageCountRetType) { + setIntakeResponseGetUndeliveredMessageCountAttributeType(&o.UndeliveredMessageCount, v) +} + +// GetUri returns the Uri field value +func (o *IntakeResponse) GetUri() (ret IntakeResponseGetUriRetType) { + ret, _ = o.GetUriOk() + return ret +} + +// GetUriOk returns a tuple with the Uri field value +// and a boolean to check if the value has been set. +func (o *IntakeResponse) GetUriOk() (ret IntakeResponseGetUriRetType, ok bool) { + return getIntakeResponseGetUriAttributeTypeOk(o.Uri) +} + +// SetUri sets field value +func (o *IntakeResponse) SetUri(v IntakeResponseGetUriRetType) { + setIntakeResponseGetUriAttributeType(&o.Uri, v) +} + +func (o IntakeResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getIntakeResponseGetCatalogAttributeTypeOk(o.Catalog); ok { + toSerialize["Catalog"] = val + } + if val, ok := getIntakeResponseGetCreateTimeAttributeTypeOk(o.CreateTime); ok { + toSerialize["CreateTime"] = val + } + if val, ok := getIntakeResponseGetDeadLetterTopicAttributeTypeOk(o.DeadLetterTopic); ok { + toSerialize["DeadLetterTopic"] = val + } + if val, ok := getIntakeResponseGetDescriptionAttributeTypeOk(o.Description); ok { + toSerialize["Description"] = val + } + if val, ok := getIntakeResponseGetDisplayNameAttributeTypeOk(o.DisplayName); ok { + toSerialize["DisplayName"] = val + } + if val, ok := getIntakeResponseGetFailureMessageAttributeTypeOk(o.FailureMessage); ok { + toSerialize["FailureMessage"] = val + } + if val, ok := getIntakeResponseGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getIntakeResponseGetIntakeRunnerIdAttributeTypeOk(o.IntakeRunnerId); ok { + toSerialize["IntakeRunnerId"] = val + } + if val, ok := getIntakeResponseGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } + if val, ok := getIntakeResponseGetStateAttributeTypeOk(o.State); ok { + toSerialize["State"] = val + } + if val, ok := getIntakeResponseGetTopicAttributeTypeOk(o.Topic); ok { + toSerialize["Topic"] = val + } + if val, ok := getIntakeResponseGetUndeliveredMessageCountAttributeTypeOk(o.UndeliveredMessageCount); ok { + toSerialize["UndeliveredMessageCount"] = val + } + if val, ok := getIntakeResponseGetUriAttributeTypeOk(o.Uri); ok { + toSerialize["Uri"] = val + } + return toSerialize, nil +} + +type NullableIntakeResponse struct { + value *IntakeResponse + isSet bool +} + +func (v NullableIntakeResponse) Get() *IntakeResponse { + return v.value +} + +func (v *NullableIntakeResponse) Set(val *IntakeResponse) { + v.value = val + v.isSet = true +} + +func (v NullableIntakeResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableIntakeResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIntakeResponse(val *IntakeResponse) *NullableIntakeResponse { + return &NullableIntakeResponse{value: val, isSet: true} +} + +func (v NullableIntakeResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIntakeResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/intake/model_intake_response_test.go b/services/intake/model_intake_response_test.go new file mode 100644 index 000000000..3ae14497a --- /dev/null +++ b/services/intake/model_intake_response_test.go @@ -0,0 +1,72 @@ +/* +STACKIT Intake API + +This API provides endpoints for managing Intakes. + +API version: 1beta.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package intake + +import ( + "testing" +) + +// isEnum + +func TestIntakeResponseState_UnmarshalJSON(t *testing.T) { + type args struct { + src []byte + } + tests := []struct { + name string + args args + wantErr bool + }{ + { + name: `success - possible enum value no. 1`, + args: args{ + src: []byte(`"reconciling"`), + }, + wantErr: false, + }, + { + name: `success - possible enum value no. 2`, + args: args{ + src: []byte(`"active"`), + }, + wantErr: false, + }, + { + name: `success - possible enum value no. 3`, + args: args{ + src: []byte(`"deleting"`), + }, + wantErr: false, + }, + { + name: `success - possible enum value no. 4`, + args: args{ + src: []byte(`"failed"`), + }, + wantErr: false, + }, + { + name: "fail", + args: args{ + src: []byte("\"FOOBAR\""), + }, + wantErr: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + v := IntakeResponseState("") + if err := v.UnmarshalJSON(tt.args.src); (err != nil) != tt.wantErr { + t.Errorf("UnmarshalJSON() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} diff --git a/services/intake/model_intake_runner_response.go b/services/intake/model_intake_runner_response.go new file mode 100644 index 000000000..2f5bf88c8 --- /dev/null +++ b/services/intake/model_intake_runner_response.go @@ -0,0 +1,599 @@ +/* +STACKIT Intake API + +This API provides endpoints for managing Intakes. + +API version: 1beta.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package intake + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the IntakeRunnerResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IntakeRunnerResponse{} + +/* + types and functions for create_time +*/ + +// isDateTime +type IntakeRunnerResponseGetCreateTimeAttributeType = *time.Time +type IntakeRunnerResponseGetCreateTimeArgType = time.Time +type IntakeRunnerResponseGetCreateTimeRetType = time.Time + +func getIntakeRunnerResponseGetCreateTimeAttributeTypeOk(arg IntakeRunnerResponseGetCreateTimeAttributeType) (ret IntakeRunnerResponseGetCreateTimeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setIntakeRunnerResponseGetCreateTimeAttributeType(arg *IntakeRunnerResponseGetCreateTimeAttributeType, val IntakeRunnerResponseGetCreateTimeRetType) { + *arg = &val +} + +/* + types and functions for description +*/ + +// isNotNullableString +type IntakeRunnerResponseGetDescriptionAttributeType = *string + +func getIntakeRunnerResponseGetDescriptionAttributeTypeOk(arg IntakeRunnerResponseGetDescriptionAttributeType) (ret IntakeRunnerResponseGetDescriptionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setIntakeRunnerResponseGetDescriptionAttributeType(arg *IntakeRunnerResponseGetDescriptionAttributeType, val IntakeRunnerResponseGetDescriptionRetType) { + *arg = &val +} + +type IntakeRunnerResponseGetDescriptionArgType = string +type IntakeRunnerResponseGetDescriptionRetType = string + +/* + types and functions for displayName +*/ + +// isNotNullableString +type IntakeRunnerResponseGetDisplayNameAttributeType = *string + +func getIntakeRunnerResponseGetDisplayNameAttributeTypeOk(arg IntakeRunnerResponseGetDisplayNameAttributeType) (ret IntakeRunnerResponseGetDisplayNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setIntakeRunnerResponseGetDisplayNameAttributeType(arg *IntakeRunnerResponseGetDisplayNameAttributeType, val IntakeRunnerResponseGetDisplayNameRetType) { + *arg = &val +} + +type IntakeRunnerResponseGetDisplayNameArgType = string +type IntakeRunnerResponseGetDisplayNameRetType = string + +/* + types and functions for id +*/ + +// isNotNullableString +type IntakeRunnerResponseGetIdAttributeType = *string + +func getIntakeRunnerResponseGetIdAttributeTypeOk(arg IntakeRunnerResponseGetIdAttributeType) (ret IntakeRunnerResponseGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setIntakeRunnerResponseGetIdAttributeType(arg *IntakeRunnerResponseGetIdAttributeType, val IntakeRunnerResponseGetIdRetType) { + *arg = &val +} + +type IntakeRunnerResponseGetIdArgType = string +type IntakeRunnerResponseGetIdRetType = string + +/* + types and functions for labels +*/ + +// isContainer +type IntakeRunnerResponseGetLabelsAttributeType = *map[string]string +type IntakeRunnerResponseGetLabelsArgType = *map[string]string +type IntakeRunnerResponseGetLabelsRetType = *map[string]string + +func getIntakeRunnerResponseGetLabelsAttributeTypeOk(arg IntakeRunnerResponseGetLabelsAttributeType) (ret IntakeRunnerResponseGetLabelsRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg, true +} + +func setIntakeRunnerResponseGetLabelsAttributeType(arg *IntakeRunnerResponseGetLabelsAttributeType, val IntakeRunnerResponseGetLabelsRetType) { + *arg = val +} + +/* + types and functions for maxMessageSizeKiB +*/ + +// isInteger +type IntakeRunnerResponseGetMaxMessageSizeKiBAttributeType = *int64 +type IntakeRunnerResponseGetMaxMessageSizeKiBArgType = int64 +type IntakeRunnerResponseGetMaxMessageSizeKiBRetType = int64 + +func getIntakeRunnerResponseGetMaxMessageSizeKiBAttributeTypeOk(arg IntakeRunnerResponseGetMaxMessageSizeKiBAttributeType) (ret IntakeRunnerResponseGetMaxMessageSizeKiBRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setIntakeRunnerResponseGetMaxMessageSizeKiBAttributeType(arg *IntakeRunnerResponseGetMaxMessageSizeKiBAttributeType, val IntakeRunnerResponseGetMaxMessageSizeKiBRetType) { + *arg = &val +} + +/* + types and functions for maxMessagesPerHour +*/ + +// isInteger +type IntakeRunnerResponseGetMaxMessagesPerHourAttributeType = *int64 +type IntakeRunnerResponseGetMaxMessagesPerHourArgType = int64 +type IntakeRunnerResponseGetMaxMessagesPerHourRetType = int64 + +func getIntakeRunnerResponseGetMaxMessagesPerHourAttributeTypeOk(arg IntakeRunnerResponseGetMaxMessagesPerHourAttributeType) (ret IntakeRunnerResponseGetMaxMessagesPerHourRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setIntakeRunnerResponseGetMaxMessagesPerHourAttributeType(arg *IntakeRunnerResponseGetMaxMessagesPerHourAttributeType, val IntakeRunnerResponseGetMaxMessagesPerHourRetType) { + *arg = &val +} + +/* + types and functions for state +*/ + +// isEnum + +// IntakeRunnerResponseState The current state of the resource. +// value type for enums +type IntakeRunnerResponseState string + +// List of State +const ( + INTAKERUNNERRESPONSESTATE_RECONCILING IntakeRunnerResponseState = "reconciling" + INTAKERUNNERRESPONSESTATE_ACTIVE IntakeRunnerResponseState = "active" + INTAKERUNNERRESPONSESTATE_DELETING IntakeRunnerResponseState = "deleting" +) + +// All allowed values of IntakeRunnerResponse enum +var AllowedIntakeRunnerResponseStateEnumValues = []IntakeRunnerResponseState{ + "reconciling", + "active", + "deleting", +} + +func (v *IntakeRunnerResponseState) UnmarshalJSON(src []byte) error { + // use a type alias to prevent infinite recursion during unmarshal, + // see https://biscuit.ninja/posts/go-avoid-an-infitine-loop-with-custom-json-unmarshallers + type TmpJson IntakeRunnerResponseState + var value TmpJson + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + // Allow unmarshalling zero value for testing purposes + var zeroValue TmpJson + if value == zeroValue { + return nil + } + enumTypeValue := IntakeRunnerResponseState(value) + for _, existing := range AllowedIntakeRunnerResponseStateEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid IntakeRunnerResponse", value) +} + +// NewIntakeRunnerResponseStateFromValue returns a pointer to a valid IntakeRunnerResponseState +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewIntakeRunnerResponseStateFromValue(v IntakeRunnerResponseState) (*IntakeRunnerResponseState, error) { + ev := IntakeRunnerResponseState(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for IntakeRunnerResponseState: valid values are %v", v, AllowedIntakeRunnerResponseStateEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v IntakeRunnerResponseState) IsValid() bool { + for _, existing := range AllowedIntakeRunnerResponseStateEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to StateState value +func (v IntakeRunnerResponseState) Ptr() *IntakeRunnerResponseState { + return &v +} + +type NullableIntakeRunnerResponseState struct { + value *IntakeRunnerResponseState + isSet bool +} + +func (v NullableIntakeRunnerResponseState) Get() *IntakeRunnerResponseState { + return v.value +} + +func (v *NullableIntakeRunnerResponseState) Set(val *IntakeRunnerResponseState) { + v.value = val + v.isSet = true +} + +func (v NullableIntakeRunnerResponseState) IsSet() bool { + return v.isSet +} + +func (v *NullableIntakeRunnerResponseState) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIntakeRunnerResponseState(val *IntakeRunnerResponseState) *NullableIntakeRunnerResponseState { + return &NullableIntakeRunnerResponseState{value: val, isSet: true} +} + +func (v NullableIntakeRunnerResponseState) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIntakeRunnerResponseState) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type IntakeRunnerResponseGetStateAttributeType = *IntakeRunnerResponseState +type IntakeRunnerResponseGetStateArgType = IntakeRunnerResponseState +type IntakeRunnerResponseGetStateRetType = IntakeRunnerResponseState + +func getIntakeRunnerResponseGetStateAttributeTypeOk(arg IntakeRunnerResponseGetStateAttributeType) (ret IntakeRunnerResponseGetStateRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setIntakeRunnerResponseGetStateAttributeType(arg *IntakeRunnerResponseGetStateAttributeType, val IntakeRunnerResponseGetStateRetType) { + *arg = &val +} + +/* + types and functions for uri +*/ + +// isNotNullableString +type IntakeRunnerResponseGetUriAttributeType = *string + +func getIntakeRunnerResponseGetUriAttributeTypeOk(arg IntakeRunnerResponseGetUriAttributeType) (ret IntakeRunnerResponseGetUriRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setIntakeRunnerResponseGetUriAttributeType(arg *IntakeRunnerResponseGetUriAttributeType, val IntakeRunnerResponseGetUriRetType) { + *arg = &val +} + +type IntakeRunnerResponseGetUriArgType = string +type IntakeRunnerResponseGetUriRetType = string + +// IntakeRunnerResponse struct for IntakeRunnerResponse +type IntakeRunnerResponse struct { + // The point in time the resource was created. + // REQUIRED + CreateTime IntakeRunnerResponseGetCreateTimeAttributeType `json:"create_time" required:"true"` + // The description is a longer text chosen by the user to provide more context for the resource. + Description IntakeRunnerResponseGetDescriptionAttributeType `json:"description,omitempty"` + // The display name is a short name chosen by the user to identify the resource. + // REQUIRED + DisplayName IntakeRunnerResponseGetDisplayNameAttributeType `json:"displayName" required:"true"` + // A auto generated unique id which identifies the resource. + // REQUIRED + Id IntakeRunnerResponseGetIdAttributeType `json:"id" required:"true"` + // Labels are a set of key-value pairs assigned to resources. + Labels IntakeRunnerResponseGetLabelsAttributeType `json:"labels,omitempty"` + // The maximum size of a message in kibibytes (1 KiB = 1024 bytes). + // REQUIRED + MaxMessageSizeKiB IntakeRunnerResponseGetMaxMessageSizeKiBAttributeType `json:"maxMessageSizeKiB" required:"true"` + // The maximum number of messages per hour. + // REQUIRED + MaxMessagesPerHour IntakeRunnerResponseGetMaxMessagesPerHourAttributeType `json:"maxMessagesPerHour" required:"true"` + // The current state of the resource. + // REQUIRED + State IntakeRunnerResponseGetStateAttributeType `json:"state" required:"true"` + // The URI for reaching the resource. + // REQUIRED + Uri IntakeRunnerResponseGetUriAttributeType `json:"uri" required:"true"` +} + +type _IntakeRunnerResponse IntakeRunnerResponse + +// NewIntakeRunnerResponse instantiates a new IntakeRunnerResponse 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 NewIntakeRunnerResponse(createTime IntakeRunnerResponseGetCreateTimeArgType, displayName IntakeRunnerResponseGetDisplayNameArgType, id IntakeRunnerResponseGetIdArgType, maxMessageSizeKiB IntakeRunnerResponseGetMaxMessageSizeKiBArgType, maxMessagesPerHour IntakeRunnerResponseGetMaxMessagesPerHourArgType, state IntakeRunnerResponseGetStateArgType, uri IntakeRunnerResponseGetUriArgType) *IntakeRunnerResponse { + this := IntakeRunnerResponse{} + setIntakeRunnerResponseGetCreateTimeAttributeType(&this.CreateTime, createTime) + setIntakeRunnerResponseGetDisplayNameAttributeType(&this.DisplayName, displayName) + setIntakeRunnerResponseGetIdAttributeType(&this.Id, id) + setIntakeRunnerResponseGetMaxMessageSizeKiBAttributeType(&this.MaxMessageSizeKiB, maxMessageSizeKiB) + setIntakeRunnerResponseGetMaxMessagesPerHourAttributeType(&this.MaxMessagesPerHour, maxMessagesPerHour) + setIntakeRunnerResponseGetStateAttributeType(&this.State, state) + setIntakeRunnerResponseGetUriAttributeType(&this.Uri, uri) + return &this +} + +// NewIntakeRunnerResponseWithDefaults instantiates a new IntakeRunnerResponse 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 NewIntakeRunnerResponseWithDefaults() *IntakeRunnerResponse { + this := IntakeRunnerResponse{} + return &this +} + +// GetCreateTime returns the CreateTime field value +func (o *IntakeRunnerResponse) GetCreateTime() (ret IntakeRunnerResponseGetCreateTimeRetType) { + ret, _ = o.GetCreateTimeOk() + return ret +} + +// GetCreateTimeOk returns a tuple with the CreateTime field value +// and a boolean to check if the value has been set. +func (o *IntakeRunnerResponse) GetCreateTimeOk() (ret IntakeRunnerResponseGetCreateTimeRetType, ok bool) { + return getIntakeRunnerResponseGetCreateTimeAttributeTypeOk(o.CreateTime) +} + +// SetCreateTime sets field value +func (o *IntakeRunnerResponse) SetCreateTime(v IntakeRunnerResponseGetCreateTimeRetType) { + setIntakeRunnerResponseGetCreateTimeAttributeType(&o.CreateTime, v) +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *IntakeRunnerResponse) GetDescription() (res IntakeRunnerResponseGetDescriptionRetType) { + res, _ = o.GetDescriptionOk() + return +} + +// 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 *IntakeRunnerResponse) GetDescriptionOk() (ret IntakeRunnerResponseGetDescriptionRetType, ok bool) { + return getIntakeRunnerResponseGetDescriptionAttributeTypeOk(o.Description) +} + +// HasDescription returns a boolean if a field has been set. +func (o *IntakeRunnerResponse) HasDescription() bool { + _, ok := o.GetDescriptionOk() + return ok +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *IntakeRunnerResponse) SetDescription(v IntakeRunnerResponseGetDescriptionRetType) { + setIntakeRunnerResponseGetDescriptionAttributeType(&o.Description, v) +} + +// GetDisplayName returns the DisplayName field value +func (o *IntakeRunnerResponse) GetDisplayName() (ret IntakeRunnerResponseGetDisplayNameRetType) { + ret, _ = o.GetDisplayNameOk() + return ret +} + +// GetDisplayNameOk returns a tuple with the DisplayName field value +// and a boolean to check if the value has been set. +func (o *IntakeRunnerResponse) GetDisplayNameOk() (ret IntakeRunnerResponseGetDisplayNameRetType, ok bool) { + return getIntakeRunnerResponseGetDisplayNameAttributeTypeOk(o.DisplayName) +} + +// SetDisplayName sets field value +func (o *IntakeRunnerResponse) SetDisplayName(v IntakeRunnerResponseGetDisplayNameRetType) { + setIntakeRunnerResponseGetDisplayNameAttributeType(&o.DisplayName, v) +} + +// GetId returns the Id field value +func (o *IntakeRunnerResponse) GetId() (ret IntakeRunnerResponseGetIdRetType) { + ret, _ = o.GetIdOk() + return ret +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *IntakeRunnerResponse) GetIdOk() (ret IntakeRunnerResponseGetIdRetType, ok bool) { + return getIntakeRunnerResponseGetIdAttributeTypeOk(o.Id) +} + +// SetId sets field value +func (o *IntakeRunnerResponse) SetId(v IntakeRunnerResponseGetIdRetType) { + setIntakeRunnerResponseGetIdAttributeType(&o.Id, v) +} + +// GetLabels returns the Labels field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *IntakeRunnerResponse) GetLabels() (res IntakeRunnerResponseGetLabelsRetType) { + res, _ = o.GetLabelsOk() + return +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IntakeRunnerResponse) GetLabelsOk() (ret IntakeRunnerResponseGetLabelsRetType, ok bool) { + return getIntakeRunnerResponseGetLabelsAttributeTypeOk(o.Labels) +} + +// HasLabels returns a boolean if a field has been set. +func (o *IntakeRunnerResponse) HasLabels() bool { + _, ok := o.GetLabelsOk() + return ok +} + +// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. +func (o *IntakeRunnerResponse) SetLabels(v IntakeRunnerResponseGetLabelsRetType) { + setIntakeRunnerResponseGetLabelsAttributeType(&o.Labels, v) +} + +// GetMaxMessageSizeKiB returns the MaxMessageSizeKiB field value +func (o *IntakeRunnerResponse) GetMaxMessageSizeKiB() (ret IntakeRunnerResponseGetMaxMessageSizeKiBRetType) { + ret, _ = o.GetMaxMessageSizeKiBOk() + return ret +} + +// GetMaxMessageSizeKiBOk returns a tuple with the MaxMessageSizeKiB field value +// and a boolean to check if the value has been set. +func (o *IntakeRunnerResponse) GetMaxMessageSizeKiBOk() (ret IntakeRunnerResponseGetMaxMessageSizeKiBRetType, ok bool) { + return getIntakeRunnerResponseGetMaxMessageSizeKiBAttributeTypeOk(o.MaxMessageSizeKiB) +} + +// SetMaxMessageSizeKiB sets field value +func (o *IntakeRunnerResponse) SetMaxMessageSizeKiB(v IntakeRunnerResponseGetMaxMessageSizeKiBRetType) { + setIntakeRunnerResponseGetMaxMessageSizeKiBAttributeType(&o.MaxMessageSizeKiB, v) +} + +// GetMaxMessagesPerHour returns the MaxMessagesPerHour field value +func (o *IntakeRunnerResponse) GetMaxMessagesPerHour() (ret IntakeRunnerResponseGetMaxMessagesPerHourRetType) { + ret, _ = o.GetMaxMessagesPerHourOk() + return ret +} + +// GetMaxMessagesPerHourOk returns a tuple with the MaxMessagesPerHour field value +// and a boolean to check if the value has been set. +func (o *IntakeRunnerResponse) GetMaxMessagesPerHourOk() (ret IntakeRunnerResponseGetMaxMessagesPerHourRetType, ok bool) { + return getIntakeRunnerResponseGetMaxMessagesPerHourAttributeTypeOk(o.MaxMessagesPerHour) +} + +// SetMaxMessagesPerHour sets field value +func (o *IntakeRunnerResponse) SetMaxMessagesPerHour(v IntakeRunnerResponseGetMaxMessagesPerHourRetType) { + setIntakeRunnerResponseGetMaxMessagesPerHourAttributeType(&o.MaxMessagesPerHour, v) +} + +// GetState returns the State field value +func (o *IntakeRunnerResponse) GetState() (ret IntakeRunnerResponseGetStateRetType) { + ret, _ = o.GetStateOk() + return ret +} + +// GetStateOk returns a tuple with the State field value +// and a boolean to check if the value has been set. +func (o *IntakeRunnerResponse) GetStateOk() (ret IntakeRunnerResponseGetStateRetType, ok bool) { + return getIntakeRunnerResponseGetStateAttributeTypeOk(o.State) +} + +// SetState sets field value +func (o *IntakeRunnerResponse) SetState(v IntakeRunnerResponseGetStateRetType) { + setIntakeRunnerResponseGetStateAttributeType(&o.State, v) +} + +// GetUri returns the Uri field value +func (o *IntakeRunnerResponse) GetUri() (ret IntakeRunnerResponseGetUriRetType) { + ret, _ = o.GetUriOk() + return ret +} + +// GetUriOk returns a tuple with the Uri field value +// and a boolean to check if the value has been set. +func (o *IntakeRunnerResponse) GetUriOk() (ret IntakeRunnerResponseGetUriRetType, ok bool) { + return getIntakeRunnerResponseGetUriAttributeTypeOk(o.Uri) +} + +// SetUri sets field value +func (o *IntakeRunnerResponse) SetUri(v IntakeRunnerResponseGetUriRetType) { + setIntakeRunnerResponseGetUriAttributeType(&o.Uri, v) +} + +func (o IntakeRunnerResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getIntakeRunnerResponseGetCreateTimeAttributeTypeOk(o.CreateTime); ok { + toSerialize["CreateTime"] = val + } + if val, ok := getIntakeRunnerResponseGetDescriptionAttributeTypeOk(o.Description); ok { + toSerialize["Description"] = val + } + if val, ok := getIntakeRunnerResponseGetDisplayNameAttributeTypeOk(o.DisplayName); ok { + toSerialize["DisplayName"] = val + } + if val, ok := getIntakeRunnerResponseGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getIntakeRunnerResponseGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } + if val, ok := getIntakeRunnerResponseGetMaxMessageSizeKiBAttributeTypeOk(o.MaxMessageSizeKiB); ok { + toSerialize["MaxMessageSizeKiB"] = val + } + if val, ok := getIntakeRunnerResponseGetMaxMessagesPerHourAttributeTypeOk(o.MaxMessagesPerHour); ok { + toSerialize["MaxMessagesPerHour"] = val + } + if val, ok := getIntakeRunnerResponseGetStateAttributeTypeOk(o.State); ok { + toSerialize["State"] = val + } + if val, ok := getIntakeRunnerResponseGetUriAttributeTypeOk(o.Uri); ok { + toSerialize["Uri"] = val + } + return toSerialize, nil +} + +type NullableIntakeRunnerResponse struct { + value *IntakeRunnerResponse + isSet bool +} + +func (v NullableIntakeRunnerResponse) Get() *IntakeRunnerResponse { + return v.value +} + +func (v *NullableIntakeRunnerResponse) Set(val *IntakeRunnerResponse) { + v.value = val + v.isSet = true +} + +func (v NullableIntakeRunnerResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableIntakeRunnerResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIntakeRunnerResponse(val *IntakeRunnerResponse) *NullableIntakeRunnerResponse { + return &NullableIntakeRunnerResponse{value: val, isSet: true} +} + +func (v NullableIntakeRunnerResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIntakeRunnerResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/intake/model_intake_runner_response_test.go b/services/intake/model_intake_runner_response_test.go new file mode 100644 index 000000000..53a618873 --- /dev/null +++ b/services/intake/model_intake_runner_response_test.go @@ -0,0 +1,65 @@ +/* +STACKIT Intake API + +This API provides endpoints for managing Intakes. + +API version: 1beta.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package intake + +import ( + "testing" +) + +// isEnum + +func TestIntakeRunnerResponseState_UnmarshalJSON(t *testing.T) { + type args struct { + src []byte + } + tests := []struct { + name string + args args + wantErr bool + }{ + { + name: `success - possible enum value no. 1`, + args: args{ + src: []byte(`"reconciling"`), + }, + wantErr: false, + }, + { + name: `success - possible enum value no. 2`, + args: args{ + src: []byte(`"active"`), + }, + wantErr: false, + }, + { + name: `success - possible enum value no. 3`, + args: args{ + src: []byte(`"deleting"`), + }, + wantErr: false, + }, + { + name: "fail", + args: args{ + src: []byte("\"FOOBAR\""), + }, + wantErr: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + v := IntakeRunnerResponseState("") + if err := v.UnmarshalJSON(tt.args.src); (err != nil) != tt.wantErr { + t.Errorf("UnmarshalJSON() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} diff --git a/services/intake/model_intake_user_response.go b/services/intake/model_intake_user_response.go new file mode 100644 index 000000000..45e6e02fc --- /dev/null +++ b/services/intake/model_intake_user_response.go @@ -0,0 +1,603 @@ +/* +STACKIT Intake API + +This API provides endpoints for managing Intakes. + +API version: 1beta.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package intake + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the IntakeUserResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IntakeUserResponse{} + +/* + types and functions for clientConfig +*/ + +// isModel +type IntakeUserResponseGetClientConfigAttributeType = *ClientConfig +type IntakeUserResponseGetClientConfigArgType = ClientConfig +type IntakeUserResponseGetClientConfigRetType = ClientConfig + +func getIntakeUserResponseGetClientConfigAttributeTypeOk(arg IntakeUserResponseGetClientConfigAttributeType) (ret IntakeUserResponseGetClientConfigRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setIntakeUserResponseGetClientConfigAttributeType(arg *IntakeUserResponseGetClientConfigAttributeType, val IntakeUserResponseGetClientConfigRetType) { + *arg = &val +} + +/* + types and functions for create_time +*/ + +// isDateTime +type IntakeUserResponseGetCreateTimeAttributeType = *time.Time +type IntakeUserResponseGetCreateTimeArgType = time.Time +type IntakeUserResponseGetCreateTimeRetType = time.Time + +func getIntakeUserResponseGetCreateTimeAttributeTypeOk(arg IntakeUserResponseGetCreateTimeAttributeType) (ret IntakeUserResponseGetCreateTimeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setIntakeUserResponseGetCreateTimeAttributeType(arg *IntakeUserResponseGetCreateTimeAttributeType, val IntakeUserResponseGetCreateTimeRetType) { + *arg = &val +} + +/* + types and functions for description +*/ + +// isNotNullableString +type IntakeUserResponseGetDescriptionAttributeType = *string + +func getIntakeUserResponseGetDescriptionAttributeTypeOk(arg IntakeUserResponseGetDescriptionAttributeType) (ret IntakeUserResponseGetDescriptionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setIntakeUserResponseGetDescriptionAttributeType(arg *IntakeUserResponseGetDescriptionAttributeType, val IntakeUserResponseGetDescriptionRetType) { + *arg = &val +} + +type IntakeUserResponseGetDescriptionArgType = string +type IntakeUserResponseGetDescriptionRetType = string + +/* + types and functions for displayName +*/ + +// isNotNullableString +type IntakeUserResponseGetDisplayNameAttributeType = *string + +func getIntakeUserResponseGetDisplayNameAttributeTypeOk(arg IntakeUserResponseGetDisplayNameAttributeType) (ret IntakeUserResponseGetDisplayNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setIntakeUserResponseGetDisplayNameAttributeType(arg *IntakeUserResponseGetDisplayNameAttributeType, val IntakeUserResponseGetDisplayNameRetType) { + *arg = &val +} + +type IntakeUserResponseGetDisplayNameArgType = string +type IntakeUserResponseGetDisplayNameRetType = string + +/* + types and functions for id +*/ + +// isNotNullableString +type IntakeUserResponseGetIdAttributeType = *string + +func getIntakeUserResponseGetIdAttributeTypeOk(arg IntakeUserResponseGetIdAttributeType) (ret IntakeUserResponseGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setIntakeUserResponseGetIdAttributeType(arg *IntakeUserResponseGetIdAttributeType, val IntakeUserResponseGetIdRetType) { + *arg = &val +} + +type IntakeUserResponseGetIdArgType = string +type IntakeUserResponseGetIdRetType = string + +/* + types and functions for labels +*/ + +// isContainer +type IntakeUserResponseGetLabelsAttributeType = *map[string]string +type IntakeUserResponseGetLabelsArgType = *map[string]string +type IntakeUserResponseGetLabelsRetType = *map[string]string + +func getIntakeUserResponseGetLabelsAttributeTypeOk(arg IntakeUserResponseGetLabelsAttributeType) (ret IntakeUserResponseGetLabelsRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg, true +} + +func setIntakeUserResponseGetLabelsAttributeType(arg *IntakeUserResponseGetLabelsAttributeType, val IntakeUserResponseGetLabelsRetType) { + *arg = val +} + +/* + types and functions for state +*/ + +// isEnum + +// IntakeUserResponseState The current state of the resource. +// value type for enums +type IntakeUserResponseState string + +// List of State +const ( + INTAKEUSERRESPONSESTATE_RECONCILING IntakeUserResponseState = "reconciling" + INTAKEUSERRESPONSESTATE_ACTIVE IntakeUserResponseState = "active" + INTAKEUSERRESPONSESTATE_DELETING IntakeUserResponseState = "deleting" +) + +// All allowed values of IntakeUserResponse enum +var AllowedIntakeUserResponseStateEnumValues = []IntakeUserResponseState{ + "reconciling", + "active", + "deleting", +} + +func (v *IntakeUserResponseState) UnmarshalJSON(src []byte) error { + // use a type alias to prevent infinite recursion during unmarshal, + // see https://biscuit.ninja/posts/go-avoid-an-infitine-loop-with-custom-json-unmarshallers + type TmpJson IntakeUserResponseState + var value TmpJson + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + // Allow unmarshalling zero value for testing purposes + var zeroValue TmpJson + if value == zeroValue { + return nil + } + enumTypeValue := IntakeUserResponseState(value) + for _, existing := range AllowedIntakeUserResponseStateEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid IntakeUserResponse", value) +} + +// NewIntakeUserResponseStateFromValue returns a pointer to a valid IntakeUserResponseState +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewIntakeUserResponseStateFromValue(v IntakeUserResponseState) (*IntakeUserResponseState, error) { + ev := IntakeUserResponseState(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for IntakeUserResponseState: valid values are %v", v, AllowedIntakeUserResponseStateEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v IntakeUserResponseState) IsValid() bool { + for _, existing := range AllowedIntakeUserResponseStateEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to StateState value +func (v IntakeUserResponseState) Ptr() *IntakeUserResponseState { + return &v +} + +type NullableIntakeUserResponseState struct { + value *IntakeUserResponseState + isSet bool +} + +func (v NullableIntakeUserResponseState) Get() *IntakeUserResponseState { + return v.value +} + +func (v *NullableIntakeUserResponseState) Set(val *IntakeUserResponseState) { + v.value = val + v.isSet = true +} + +func (v NullableIntakeUserResponseState) IsSet() bool { + return v.isSet +} + +func (v *NullableIntakeUserResponseState) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIntakeUserResponseState(val *IntakeUserResponseState) *NullableIntakeUserResponseState { + return &NullableIntakeUserResponseState{value: val, isSet: true} +} + +func (v NullableIntakeUserResponseState) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIntakeUserResponseState) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type IntakeUserResponseGetStateAttributeType = *IntakeUserResponseState +type IntakeUserResponseGetStateArgType = IntakeUserResponseState +type IntakeUserResponseGetStateRetType = IntakeUserResponseState + +func getIntakeUserResponseGetStateAttributeTypeOk(arg IntakeUserResponseGetStateAttributeType) (ret IntakeUserResponseGetStateRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setIntakeUserResponseGetStateAttributeType(arg *IntakeUserResponseGetStateAttributeType, val IntakeUserResponseGetStateRetType) { + *arg = &val +} + +/* + types and functions for type +*/ + +// isEnumRef +type IntakeUserResponseGetTypeAttributeType = *UserType +type IntakeUserResponseGetTypeArgType = UserType +type IntakeUserResponseGetTypeRetType = UserType + +func getIntakeUserResponseGetTypeAttributeTypeOk(arg IntakeUserResponseGetTypeAttributeType) (ret IntakeUserResponseGetTypeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setIntakeUserResponseGetTypeAttributeType(arg *IntakeUserResponseGetTypeAttributeType, val IntakeUserResponseGetTypeRetType) { + *arg = &val +} + +/* + types and functions for user +*/ + +// isNotNullableString +type IntakeUserResponseGetUserAttributeType = *string + +func getIntakeUserResponseGetUserAttributeTypeOk(arg IntakeUserResponseGetUserAttributeType) (ret IntakeUserResponseGetUserRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setIntakeUserResponseGetUserAttributeType(arg *IntakeUserResponseGetUserAttributeType, val IntakeUserResponseGetUserRetType) { + *arg = &val +} + +type IntakeUserResponseGetUserArgType = string +type IntakeUserResponseGetUserRetType = string + +// IntakeUserResponse struct for IntakeUserResponse +type IntakeUserResponse struct { + ClientConfig IntakeUserResponseGetClientConfigAttributeType `json:"clientConfig,omitempty"` + // The point in time the resource was created. + // REQUIRED + CreateTime IntakeUserResponseGetCreateTimeAttributeType `json:"create_time" required:"true"` + // The description is a longer text chosen by the user to provide more context for the resource. + Description IntakeUserResponseGetDescriptionAttributeType `json:"description,omitempty"` + // The display name is a short name chosen by the user to identify the resource. + // REQUIRED + DisplayName IntakeUserResponseGetDisplayNameAttributeType `json:"displayName" required:"true"` + // A auto generated unique id which identifies the resource. + // REQUIRED + Id IntakeUserResponseGetIdAttributeType `json:"id" required:"true"` + // Labels are a set of key-value pairs assigned to resources. + Labels IntakeUserResponseGetLabelsAttributeType `json:"labels,omitempty"` + // The current state of the resource. + // REQUIRED + State IntakeUserResponseGetStateAttributeType `json:"state" required:"true"` + // REQUIRED + Type IntakeUserResponseGetTypeAttributeType `json:"type" required:"true"` + // The user to connect to the intake. + // REQUIRED + User IntakeUserResponseGetUserAttributeType `json:"user" required:"true"` +} + +type _IntakeUserResponse IntakeUserResponse + +// NewIntakeUserResponse instantiates a new IntakeUserResponse 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 NewIntakeUserResponse(createTime IntakeUserResponseGetCreateTimeArgType, displayName IntakeUserResponseGetDisplayNameArgType, id IntakeUserResponseGetIdArgType, state IntakeUserResponseGetStateArgType, types IntakeUserResponseGetTypeArgType, user IntakeUserResponseGetUserArgType) *IntakeUserResponse { + this := IntakeUserResponse{} + setIntakeUserResponseGetCreateTimeAttributeType(&this.CreateTime, createTime) + setIntakeUserResponseGetDisplayNameAttributeType(&this.DisplayName, displayName) + setIntakeUserResponseGetIdAttributeType(&this.Id, id) + setIntakeUserResponseGetStateAttributeType(&this.State, state) + setIntakeUserResponseGetTypeAttributeType(&this.Type, types) + setIntakeUserResponseGetUserAttributeType(&this.User, user) + return &this +} + +// NewIntakeUserResponseWithDefaults instantiates a new IntakeUserResponse 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 NewIntakeUserResponseWithDefaults() *IntakeUserResponse { + this := IntakeUserResponse{} + var types UserType = USERTYPE_INTAKE + this.Type = &types + return &this +} + +// GetClientConfig returns the ClientConfig field value if set, zero value otherwise. +func (o *IntakeUserResponse) GetClientConfig() (res IntakeUserResponseGetClientConfigRetType) { + res, _ = o.GetClientConfigOk() + return +} + +// GetClientConfigOk returns a tuple with the ClientConfig field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IntakeUserResponse) GetClientConfigOk() (ret IntakeUserResponseGetClientConfigRetType, ok bool) { + return getIntakeUserResponseGetClientConfigAttributeTypeOk(o.ClientConfig) +} + +// HasClientConfig returns a boolean if a field has been set. +func (o *IntakeUserResponse) HasClientConfig() bool { + _, ok := o.GetClientConfigOk() + return ok +} + +// SetClientConfig gets a reference to the given ClientConfig and assigns it to the ClientConfig field. +func (o *IntakeUserResponse) SetClientConfig(v IntakeUserResponseGetClientConfigRetType) { + setIntakeUserResponseGetClientConfigAttributeType(&o.ClientConfig, v) +} + +// GetCreateTime returns the CreateTime field value +func (o *IntakeUserResponse) GetCreateTime() (ret IntakeUserResponseGetCreateTimeRetType) { + ret, _ = o.GetCreateTimeOk() + return ret +} + +// GetCreateTimeOk returns a tuple with the CreateTime field value +// and a boolean to check if the value has been set. +func (o *IntakeUserResponse) GetCreateTimeOk() (ret IntakeUserResponseGetCreateTimeRetType, ok bool) { + return getIntakeUserResponseGetCreateTimeAttributeTypeOk(o.CreateTime) +} + +// SetCreateTime sets field value +func (o *IntakeUserResponse) SetCreateTime(v IntakeUserResponseGetCreateTimeRetType) { + setIntakeUserResponseGetCreateTimeAttributeType(&o.CreateTime, v) +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *IntakeUserResponse) GetDescription() (res IntakeUserResponseGetDescriptionRetType) { + res, _ = o.GetDescriptionOk() + return +} + +// 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 *IntakeUserResponse) GetDescriptionOk() (ret IntakeUserResponseGetDescriptionRetType, ok bool) { + return getIntakeUserResponseGetDescriptionAttributeTypeOk(o.Description) +} + +// HasDescription returns a boolean if a field has been set. +func (o *IntakeUserResponse) HasDescription() bool { + _, ok := o.GetDescriptionOk() + return ok +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *IntakeUserResponse) SetDescription(v IntakeUserResponseGetDescriptionRetType) { + setIntakeUserResponseGetDescriptionAttributeType(&o.Description, v) +} + +// GetDisplayName returns the DisplayName field value +func (o *IntakeUserResponse) GetDisplayName() (ret IntakeUserResponseGetDisplayNameRetType) { + ret, _ = o.GetDisplayNameOk() + return ret +} + +// GetDisplayNameOk returns a tuple with the DisplayName field value +// and a boolean to check if the value has been set. +func (o *IntakeUserResponse) GetDisplayNameOk() (ret IntakeUserResponseGetDisplayNameRetType, ok bool) { + return getIntakeUserResponseGetDisplayNameAttributeTypeOk(o.DisplayName) +} + +// SetDisplayName sets field value +func (o *IntakeUserResponse) SetDisplayName(v IntakeUserResponseGetDisplayNameRetType) { + setIntakeUserResponseGetDisplayNameAttributeType(&o.DisplayName, v) +} + +// GetId returns the Id field value +func (o *IntakeUserResponse) GetId() (ret IntakeUserResponseGetIdRetType) { + ret, _ = o.GetIdOk() + return ret +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *IntakeUserResponse) GetIdOk() (ret IntakeUserResponseGetIdRetType, ok bool) { + return getIntakeUserResponseGetIdAttributeTypeOk(o.Id) +} + +// SetId sets field value +func (o *IntakeUserResponse) SetId(v IntakeUserResponseGetIdRetType) { + setIntakeUserResponseGetIdAttributeType(&o.Id, v) +} + +// GetLabels returns the Labels field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *IntakeUserResponse) GetLabels() (res IntakeUserResponseGetLabelsRetType) { + res, _ = o.GetLabelsOk() + return +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IntakeUserResponse) GetLabelsOk() (ret IntakeUserResponseGetLabelsRetType, ok bool) { + return getIntakeUserResponseGetLabelsAttributeTypeOk(o.Labels) +} + +// HasLabels returns a boolean if a field has been set. +func (o *IntakeUserResponse) HasLabels() bool { + _, ok := o.GetLabelsOk() + return ok +} + +// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. +func (o *IntakeUserResponse) SetLabels(v IntakeUserResponseGetLabelsRetType) { + setIntakeUserResponseGetLabelsAttributeType(&o.Labels, v) +} + +// GetState returns the State field value +func (o *IntakeUserResponse) GetState() (ret IntakeUserResponseGetStateRetType) { + ret, _ = o.GetStateOk() + return ret +} + +// GetStateOk returns a tuple with the State field value +// and a boolean to check if the value has been set. +func (o *IntakeUserResponse) GetStateOk() (ret IntakeUserResponseGetStateRetType, ok bool) { + return getIntakeUserResponseGetStateAttributeTypeOk(o.State) +} + +// SetState sets field value +func (o *IntakeUserResponse) SetState(v IntakeUserResponseGetStateRetType) { + setIntakeUserResponseGetStateAttributeType(&o.State, v) +} + +// GetType returns the Type field value +func (o *IntakeUserResponse) GetType() (ret IntakeUserResponseGetTypeRetType) { + ret, _ = o.GetTypeOk() + return ret +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *IntakeUserResponse) GetTypeOk() (ret IntakeUserResponseGetTypeRetType, ok bool) { + return getIntakeUserResponseGetTypeAttributeTypeOk(o.Type) +} + +// SetType sets field value +func (o *IntakeUserResponse) SetType(v IntakeUserResponseGetTypeRetType) { + setIntakeUserResponseGetTypeAttributeType(&o.Type, v) +} + +// GetUser returns the User field value +func (o *IntakeUserResponse) GetUser() (ret IntakeUserResponseGetUserRetType) { + ret, _ = o.GetUserOk() + return ret +} + +// GetUserOk returns a tuple with the User field value +// and a boolean to check if the value has been set. +func (o *IntakeUserResponse) GetUserOk() (ret IntakeUserResponseGetUserRetType, ok bool) { + return getIntakeUserResponseGetUserAttributeTypeOk(o.User) +} + +// SetUser sets field value +func (o *IntakeUserResponse) SetUser(v IntakeUserResponseGetUserRetType) { + setIntakeUserResponseGetUserAttributeType(&o.User, v) +} + +func (o IntakeUserResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getIntakeUserResponseGetClientConfigAttributeTypeOk(o.ClientConfig); ok { + toSerialize["ClientConfig"] = val + } + if val, ok := getIntakeUserResponseGetCreateTimeAttributeTypeOk(o.CreateTime); ok { + toSerialize["CreateTime"] = val + } + if val, ok := getIntakeUserResponseGetDescriptionAttributeTypeOk(o.Description); ok { + toSerialize["Description"] = val + } + if val, ok := getIntakeUserResponseGetDisplayNameAttributeTypeOk(o.DisplayName); ok { + toSerialize["DisplayName"] = val + } + if val, ok := getIntakeUserResponseGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getIntakeUserResponseGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } + if val, ok := getIntakeUserResponseGetStateAttributeTypeOk(o.State); ok { + toSerialize["State"] = val + } + if val, ok := getIntakeUserResponseGetTypeAttributeTypeOk(o.Type); ok { + toSerialize["Type"] = val + } + if val, ok := getIntakeUserResponseGetUserAttributeTypeOk(o.User); ok { + toSerialize["User"] = val + } + return toSerialize, nil +} + +type NullableIntakeUserResponse struct { + value *IntakeUserResponse + isSet bool +} + +func (v NullableIntakeUserResponse) Get() *IntakeUserResponse { + return v.value +} + +func (v *NullableIntakeUserResponse) Set(val *IntakeUserResponse) { + v.value = val + v.isSet = true +} + +func (v NullableIntakeUserResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableIntakeUserResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIntakeUserResponse(val *IntakeUserResponse) *NullableIntakeUserResponse { + return &NullableIntakeUserResponse{value: val, isSet: true} +} + +func (v NullableIntakeUserResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIntakeUserResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/intake/model_intake_user_response_test.go b/services/intake/model_intake_user_response_test.go new file mode 100644 index 000000000..a4835e44f --- /dev/null +++ b/services/intake/model_intake_user_response_test.go @@ -0,0 +1,65 @@ +/* +STACKIT Intake API + +This API provides endpoints for managing Intakes. + +API version: 1beta.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package intake + +import ( + "testing" +) + +// isEnum + +func TestIntakeUserResponseState_UnmarshalJSON(t *testing.T) { + type args struct { + src []byte + } + tests := []struct { + name string + args args + wantErr bool + }{ + { + name: `success - possible enum value no. 1`, + args: args{ + src: []byte(`"reconciling"`), + }, + wantErr: false, + }, + { + name: `success - possible enum value no. 2`, + args: args{ + src: []byte(`"active"`), + }, + wantErr: false, + }, + { + name: `success - possible enum value no. 3`, + args: args{ + src: []byte(`"deleting"`), + }, + wantErr: false, + }, + { + name: "fail", + args: args{ + src: []byte("\"FOOBAR\""), + }, + wantErr: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + v := IntakeUserResponseState("") + if err := v.UnmarshalJSON(tt.args.src); (err != nil) != tt.wantErr { + t.Errorf("UnmarshalJSON() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} diff --git a/services/intake/model_list_intake_runners_response.go b/services/intake/model_list_intake_runners_response.go new file mode 100644 index 000000000..7966355b4 --- /dev/null +++ b/services/intake/model_list_intake_runners_response.go @@ -0,0 +1,174 @@ +/* +STACKIT Intake API + +This API provides endpoints for managing Intakes. + +API version: 1beta.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package intake + +import ( + "encoding/json" +) + +// checks if the ListIntakeRunnersResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListIntakeRunnersResponse{} + +/* + types and functions for intakeRunners +*/ + +// isArray +type ListIntakeRunnersResponseGetIntakeRunnersAttributeType = *[]IntakeRunnerResponse +type ListIntakeRunnersResponseGetIntakeRunnersArgType = []IntakeRunnerResponse +type ListIntakeRunnersResponseGetIntakeRunnersRetType = []IntakeRunnerResponse + +func getListIntakeRunnersResponseGetIntakeRunnersAttributeTypeOk(arg ListIntakeRunnersResponseGetIntakeRunnersAttributeType) (ret ListIntakeRunnersResponseGetIntakeRunnersRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListIntakeRunnersResponseGetIntakeRunnersAttributeType(arg *ListIntakeRunnersResponseGetIntakeRunnersAttributeType, val ListIntakeRunnersResponseGetIntakeRunnersRetType) { + *arg = &val +} + +/* + types and functions for nextPageToken +*/ + +// isNotNullableString +type ListIntakeRunnersResponseGetNextPageTokenAttributeType = *string + +func getListIntakeRunnersResponseGetNextPageTokenAttributeTypeOk(arg ListIntakeRunnersResponseGetNextPageTokenAttributeType) (ret ListIntakeRunnersResponseGetNextPageTokenRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListIntakeRunnersResponseGetNextPageTokenAttributeType(arg *ListIntakeRunnersResponseGetNextPageTokenAttributeType, val ListIntakeRunnersResponseGetNextPageTokenRetType) { + *arg = &val +} + +type ListIntakeRunnersResponseGetNextPageTokenArgType = string +type ListIntakeRunnersResponseGetNextPageTokenRetType = string + +// ListIntakeRunnersResponse struct for ListIntakeRunnersResponse +type ListIntakeRunnersResponse struct { + // REQUIRED + IntakeRunners ListIntakeRunnersResponseGetIntakeRunnersAttributeType `json:"intakeRunners" required:"true"` + // A token to retrieve the next page of results. + NextPageToken ListIntakeRunnersResponseGetNextPageTokenAttributeType `json:"nextPageToken,omitempty"` +} + +type _ListIntakeRunnersResponse ListIntakeRunnersResponse + +// NewListIntakeRunnersResponse instantiates a new ListIntakeRunnersResponse 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 NewListIntakeRunnersResponse(intakeRunners ListIntakeRunnersResponseGetIntakeRunnersArgType) *ListIntakeRunnersResponse { + this := ListIntakeRunnersResponse{} + setListIntakeRunnersResponseGetIntakeRunnersAttributeType(&this.IntakeRunners, intakeRunners) + return &this +} + +// NewListIntakeRunnersResponseWithDefaults instantiates a new ListIntakeRunnersResponse 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 NewListIntakeRunnersResponseWithDefaults() *ListIntakeRunnersResponse { + this := ListIntakeRunnersResponse{} + return &this +} + +// GetIntakeRunners returns the IntakeRunners field value +func (o *ListIntakeRunnersResponse) GetIntakeRunners() (ret ListIntakeRunnersResponseGetIntakeRunnersRetType) { + ret, _ = o.GetIntakeRunnersOk() + return ret +} + +// GetIntakeRunnersOk returns a tuple with the IntakeRunners field value +// and a boolean to check if the value has been set. +func (o *ListIntakeRunnersResponse) GetIntakeRunnersOk() (ret ListIntakeRunnersResponseGetIntakeRunnersRetType, ok bool) { + return getListIntakeRunnersResponseGetIntakeRunnersAttributeTypeOk(o.IntakeRunners) +} + +// SetIntakeRunners sets field value +func (o *ListIntakeRunnersResponse) SetIntakeRunners(v ListIntakeRunnersResponseGetIntakeRunnersRetType) { + setListIntakeRunnersResponseGetIntakeRunnersAttributeType(&o.IntakeRunners, v) +} + +// GetNextPageToken returns the NextPageToken field value if set, zero value otherwise. +func (o *ListIntakeRunnersResponse) GetNextPageToken() (res ListIntakeRunnersResponseGetNextPageTokenRetType) { + res, _ = o.GetNextPageTokenOk() + return +} + +// GetNextPageTokenOk returns a tuple with the NextPageToken field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListIntakeRunnersResponse) GetNextPageTokenOk() (ret ListIntakeRunnersResponseGetNextPageTokenRetType, ok bool) { + return getListIntakeRunnersResponseGetNextPageTokenAttributeTypeOk(o.NextPageToken) +} + +// HasNextPageToken returns a boolean if a field has been set. +func (o *ListIntakeRunnersResponse) HasNextPageToken() bool { + _, ok := o.GetNextPageTokenOk() + return ok +} + +// SetNextPageToken gets a reference to the given string and assigns it to the NextPageToken field. +func (o *ListIntakeRunnersResponse) SetNextPageToken(v ListIntakeRunnersResponseGetNextPageTokenRetType) { + setListIntakeRunnersResponseGetNextPageTokenAttributeType(&o.NextPageToken, v) +} + +func (o ListIntakeRunnersResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getListIntakeRunnersResponseGetIntakeRunnersAttributeTypeOk(o.IntakeRunners); ok { + toSerialize["IntakeRunners"] = val + } + if val, ok := getListIntakeRunnersResponseGetNextPageTokenAttributeTypeOk(o.NextPageToken); ok { + toSerialize["NextPageToken"] = val + } + return toSerialize, nil +} + +type NullableListIntakeRunnersResponse struct { + value *ListIntakeRunnersResponse + isSet bool +} + +func (v NullableListIntakeRunnersResponse) Get() *ListIntakeRunnersResponse { + return v.value +} + +func (v *NullableListIntakeRunnersResponse) Set(val *ListIntakeRunnersResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListIntakeRunnersResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListIntakeRunnersResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListIntakeRunnersResponse(val *ListIntakeRunnersResponse) *NullableListIntakeRunnersResponse { + return &NullableListIntakeRunnersResponse{value: val, isSet: true} +} + +func (v NullableListIntakeRunnersResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListIntakeRunnersResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/intake/model_list_intake_runners_response_test.go b/services/intake/model_list_intake_runners_response_test.go new file mode 100644 index 000000000..7a79462aa --- /dev/null +++ b/services/intake/model_list_intake_runners_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Intake API + +This API provides endpoints for managing Intakes. + +API version: 1beta.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package intake diff --git a/services/intake/model_list_intake_users_response.go b/services/intake/model_list_intake_users_response.go new file mode 100644 index 000000000..c7d40d24f --- /dev/null +++ b/services/intake/model_list_intake_users_response.go @@ -0,0 +1,174 @@ +/* +STACKIT Intake API + +This API provides endpoints for managing Intakes. + +API version: 1beta.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package intake + +import ( + "encoding/json" +) + +// checks if the ListIntakeUsersResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListIntakeUsersResponse{} + +/* + types and functions for intakeUsers +*/ + +// isArray +type ListIntakeUsersResponseGetIntakeUsersAttributeType = *[]IntakeUserResponse +type ListIntakeUsersResponseGetIntakeUsersArgType = []IntakeUserResponse +type ListIntakeUsersResponseGetIntakeUsersRetType = []IntakeUserResponse + +func getListIntakeUsersResponseGetIntakeUsersAttributeTypeOk(arg ListIntakeUsersResponseGetIntakeUsersAttributeType) (ret ListIntakeUsersResponseGetIntakeUsersRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListIntakeUsersResponseGetIntakeUsersAttributeType(arg *ListIntakeUsersResponseGetIntakeUsersAttributeType, val ListIntakeUsersResponseGetIntakeUsersRetType) { + *arg = &val +} + +/* + types and functions for nextPageToken +*/ + +// isNotNullableString +type ListIntakeUsersResponseGetNextPageTokenAttributeType = *string + +func getListIntakeUsersResponseGetNextPageTokenAttributeTypeOk(arg ListIntakeUsersResponseGetNextPageTokenAttributeType) (ret ListIntakeUsersResponseGetNextPageTokenRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListIntakeUsersResponseGetNextPageTokenAttributeType(arg *ListIntakeUsersResponseGetNextPageTokenAttributeType, val ListIntakeUsersResponseGetNextPageTokenRetType) { + *arg = &val +} + +type ListIntakeUsersResponseGetNextPageTokenArgType = string +type ListIntakeUsersResponseGetNextPageTokenRetType = string + +// ListIntakeUsersResponse struct for ListIntakeUsersResponse +type ListIntakeUsersResponse struct { + // REQUIRED + IntakeUsers ListIntakeUsersResponseGetIntakeUsersAttributeType `json:"intakeUsers" required:"true"` + // A token to retrieve the next page of results. + NextPageToken ListIntakeUsersResponseGetNextPageTokenAttributeType `json:"nextPageToken,omitempty"` +} + +type _ListIntakeUsersResponse ListIntakeUsersResponse + +// NewListIntakeUsersResponse instantiates a new ListIntakeUsersResponse 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 NewListIntakeUsersResponse(intakeUsers ListIntakeUsersResponseGetIntakeUsersArgType) *ListIntakeUsersResponse { + this := ListIntakeUsersResponse{} + setListIntakeUsersResponseGetIntakeUsersAttributeType(&this.IntakeUsers, intakeUsers) + return &this +} + +// NewListIntakeUsersResponseWithDefaults instantiates a new ListIntakeUsersResponse 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 NewListIntakeUsersResponseWithDefaults() *ListIntakeUsersResponse { + this := ListIntakeUsersResponse{} + return &this +} + +// GetIntakeUsers returns the IntakeUsers field value +func (o *ListIntakeUsersResponse) GetIntakeUsers() (ret ListIntakeUsersResponseGetIntakeUsersRetType) { + ret, _ = o.GetIntakeUsersOk() + return ret +} + +// GetIntakeUsersOk returns a tuple with the IntakeUsers field value +// and a boolean to check if the value has been set. +func (o *ListIntakeUsersResponse) GetIntakeUsersOk() (ret ListIntakeUsersResponseGetIntakeUsersRetType, ok bool) { + return getListIntakeUsersResponseGetIntakeUsersAttributeTypeOk(o.IntakeUsers) +} + +// SetIntakeUsers sets field value +func (o *ListIntakeUsersResponse) SetIntakeUsers(v ListIntakeUsersResponseGetIntakeUsersRetType) { + setListIntakeUsersResponseGetIntakeUsersAttributeType(&o.IntakeUsers, v) +} + +// GetNextPageToken returns the NextPageToken field value if set, zero value otherwise. +func (o *ListIntakeUsersResponse) GetNextPageToken() (res ListIntakeUsersResponseGetNextPageTokenRetType) { + res, _ = o.GetNextPageTokenOk() + return +} + +// GetNextPageTokenOk returns a tuple with the NextPageToken field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListIntakeUsersResponse) GetNextPageTokenOk() (ret ListIntakeUsersResponseGetNextPageTokenRetType, ok bool) { + return getListIntakeUsersResponseGetNextPageTokenAttributeTypeOk(o.NextPageToken) +} + +// HasNextPageToken returns a boolean if a field has been set. +func (o *ListIntakeUsersResponse) HasNextPageToken() bool { + _, ok := o.GetNextPageTokenOk() + return ok +} + +// SetNextPageToken gets a reference to the given string and assigns it to the NextPageToken field. +func (o *ListIntakeUsersResponse) SetNextPageToken(v ListIntakeUsersResponseGetNextPageTokenRetType) { + setListIntakeUsersResponseGetNextPageTokenAttributeType(&o.NextPageToken, v) +} + +func (o ListIntakeUsersResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getListIntakeUsersResponseGetIntakeUsersAttributeTypeOk(o.IntakeUsers); ok { + toSerialize["IntakeUsers"] = val + } + if val, ok := getListIntakeUsersResponseGetNextPageTokenAttributeTypeOk(o.NextPageToken); ok { + toSerialize["NextPageToken"] = val + } + return toSerialize, nil +} + +type NullableListIntakeUsersResponse struct { + value *ListIntakeUsersResponse + isSet bool +} + +func (v NullableListIntakeUsersResponse) Get() *ListIntakeUsersResponse { + return v.value +} + +func (v *NullableListIntakeUsersResponse) Set(val *ListIntakeUsersResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListIntakeUsersResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListIntakeUsersResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListIntakeUsersResponse(val *ListIntakeUsersResponse) *NullableListIntakeUsersResponse { + return &NullableListIntakeUsersResponse{value: val, isSet: true} +} + +func (v NullableListIntakeUsersResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListIntakeUsersResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/intake/model_list_intake_users_response_test.go b/services/intake/model_list_intake_users_response_test.go new file mode 100644 index 000000000..7a79462aa --- /dev/null +++ b/services/intake/model_list_intake_users_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Intake API + +This API provides endpoints for managing Intakes. + +API version: 1beta.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package intake diff --git a/services/intake/model_list_intakes_response.go b/services/intake/model_list_intakes_response.go new file mode 100644 index 000000000..f9470d6ab --- /dev/null +++ b/services/intake/model_list_intakes_response.go @@ -0,0 +1,174 @@ +/* +STACKIT Intake API + +This API provides endpoints for managing Intakes. + +API version: 1beta.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package intake + +import ( + "encoding/json" +) + +// checks if the ListIntakesResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListIntakesResponse{} + +/* + types and functions for intakes +*/ + +// isArray +type ListIntakesResponseGetIntakesAttributeType = *[]IntakeResponse +type ListIntakesResponseGetIntakesArgType = []IntakeResponse +type ListIntakesResponseGetIntakesRetType = []IntakeResponse + +func getListIntakesResponseGetIntakesAttributeTypeOk(arg ListIntakesResponseGetIntakesAttributeType) (ret ListIntakesResponseGetIntakesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListIntakesResponseGetIntakesAttributeType(arg *ListIntakesResponseGetIntakesAttributeType, val ListIntakesResponseGetIntakesRetType) { + *arg = &val +} + +/* + types and functions for nextPageToken +*/ + +// isNotNullableString +type ListIntakesResponseGetNextPageTokenAttributeType = *string + +func getListIntakesResponseGetNextPageTokenAttributeTypeOk(arg ListIntakesResponseGetNextPageTokenAttributeType) (ret ListIntakesResponseGetNextPageTokenRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListIntakesResponseGetNextPageTokenAttributeType(arg *ListIntakesResponseGetNextPageTokenAttributeType, val ListIntakesResponseGetNextPageTokenRetType) { + *arg = &val +} + +type ListIntakesResponseGetNextPageTokenArgType = string +type ListIntakesResponseGetNextPageTokenRetType = string + +// ListIntakesResponse struct for ListIntakesResponse +type ListIntakesResponse struct { + // REQUIRED + Intakes ListIntakesResponseGetIntakesAttributeType `json:"intakes" required:"true"` + // A token to retrieve the next page of results. + NextPageToken ListIntakesResponseGetNextPageTokenAttributeType `json:"nextPageToken,omitempty"` +} + +type _ListIntakesResponse ListIntakesResponse + +// NewListIntakesResponse instantiates a new ListIntakesResponse 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 NewListIntakesResponse(intakes ListIntakesResponseGetIntakesArgType) *ListIntakesResponse { + this := ListIntakesResponse{} + setListIntakesResponseGetIntakesAttributeType(&this.Intakes, intakes) + return &this +} + +// NewListIntakesResponseWithDefaults instantiates a new ListIntakesResponse 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 NewListIntakesResponseWithDefaults() *ListIntakesResponse { + this := ListIntakesResponse{} + return &this +} + +// GetIntakes returns the Intakes field value +func (o *ListIntakesResponse) GetIntakes() (ret ListIntakesResponseGetIntakesRetType) { + ret, _ = o.GetIntakesOk() + return ret +} + +// GetIntakesOk returns a tuple with the Intakes field value +// and a boolean to check if the value has been set. +func (o *ListIntakesResponse) GetIntakesOk() (ret ListIntakesResponseGetIntakesRetType, ok bool) { + return getListIntakesResponseGetIntakesAttributeTypeOk(o.Intakes) +} + +// SetIntakes sets field value +func (o *ListIntakesResponse) SetIntakes(v ListIntakesResponseGetIntakesRetType) { + setListIntakesResponseGetIntakesAttributeType(&o.Intakes, v) +} + +// GetNextPageToken returns the NextPageToken field value if set, zero value otherwise. +func (o *ListIntakesResponse) GetNextPageToken() (res ListIntakesResponseGetNextPageTokenRetType) { + res, _ = o.GetNextPageTokenOk() + return +} + +// GetNextPageTokenOk returns a tuple with the NextPageToken field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListIntakesResponse) GetNextPageTokenOk() (ret ListIntakesResponseGetNextPageTokenRetType, ok bool) { + return getListIntakesResponseGetNextPageTokenAttributeTypeOk(o.NextPageToken) +} + +// HasNextPageToken returns a boolean if a field has been set. +func (o *ListIntakesResponse) HasNextPageToken() bool { + _, ok := o.GetNextPageTokenOk() + return ok +} + +// SetNextPageToken gets a reference to the given string and assigns it to the NextPageToken field. +func (o *ListIntakesResponse) SetNextPageToken(v ListIntakesResponseGetNextPageTokenRetType) { + setListIntakesResponseGetNextPageTokenAttributeType(&o.NextPageToken, v) +} + +func (o ListIntakesResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getListIntakesResponseGetIntakesAttributeTypeOk(o.Intakes); ok { + toSerialize["Intakes"] = val + } + if val, ok := getListIntakesResponseGetNextPageTokenAttributeTypeOk(o.NextPageToken); ok { + toSerialize["NextPageToken"] = val + } + return toSerialize, nil +} + +type NullableListIntakesResponse struct { + value *ListIntakesResponse + isSet bool +} + +func (v NullableListIntakesResponse) Get() *ListIntakesResponse { + return v.value +} + +func (v *NullableListIntakesResponse) Set(val *ListIntakesResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListIntakesResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListIntakesResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListIntakesResponse(val *ListIntakesResponse) *NullableListIntakesResponse { + return &NullableListIntakesResponse{value: val, isSet: true} +} + +func (v NullableListIntakesResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListIntakesResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/intake/model_list_intakes_response_test.go b/services/intake/model_list_intakes_response_test.go new file mode 100644 index 000000000..7a79462aa --- /dev/null +++ b/services/intake/model_list_intakes_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Intake API + +This API provides endpoints for managing Intakes. + +API version: 1beta.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package intake diff --git a/services/intake/model_update_intake_payload.go b/services/intake/model_update_intake_payload.go new file mode 100644 index 000000000..f1cccdb41 --- /dev/null +++ b/services/intake/model_update_intake_payload.go @@ -0,0 +1,321 @@ +/* +STACKIT Intake API + +This API provides endpoints for managing Intakes. + +API version: 1beta.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package intake + +import ( + "encoding/json" +) + +// checks if the UpdateIntakePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateIntakePayload{} + +/* + types and functions for catalog +*/ + +// isModel +type UpdateIntakePayloadGetCatalogAttributeType = *IntakeCatalogPatch +type UpdateIntakePayloadGetCatalogArgType = IntakeCatalogPatch +type UpdateIntakePayloadGetCatalogRetType = IntakeCatalogPatch + +func getUpdateIntakePayloadGetCatalogAttributeTypeOk(arg UpdateIntakePayloadGetCatalogAttributeType) (ret UpdateIntakePayloadGetCatalogRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateIntakePayloadGetCatalogAttributeType(arg *UpdateIntakePayloadGetCatalogAttributeType, val UpdateIntakePayloadGetCatalogRetType) { + *arg = &val +} + +/* + types and functions for description +*/ + +// isNotNullableString +type UpdateIntakePayloadGetDescriptionAttributeType = *string + +func getUpdateIntakePayloadGetDescriptionAttributeTypeOk(arg UpdateIntakePayloadGetDescriptionAttributeType) (ret UpdateIntakePayloadGetDescriptionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateIntakePayloadGetDescriptionAttributeType(arg *UpdateIntakePayloadGetDescriptionAttributeType, val UpdateIntakePayloadGetDescriptionRetType) { + *arg = &val +} + +type UpdateIntakePayloadGetDescriptionArgType = string +type UpdateIntakePayloadGetDescriptionRetType = string + +/* + types and functions for displayName +*/ + +// isNotNullableString +type UpdateIntakePayloadGetDisplayNameAttributeType = *string + +func getUpdateIntakePayloadGetDisplayNameAttributeTypeOk(arg UpdateIntakePayloadGetDisplayNameAttributeType) (ret UpdateIntakePayloadGetDisplayNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateIntakePayloadGetDisplayNameAttributeType(arg *UpdateIntakePayloadGetDisplayNameAttributeType, val UpdateIntakePayloadGetDisplayNameRetType) { + *arg = &val +} + +type UpdateIntakePayloadGetDisplayNameArgType = string +type UpdateIntakePayloadGetDisplayNameRetType = string + +/* + types and functions for intakeRunnerId +*/ + +// isNotNullableString +type UpdateIntakePayloadGetIntakeRunnerIdAttributeType = *string + +func getUpdateIntakePayloadGetIntakeRunnerIdAttributeTypeOk(arg UpdateIntakePayloadGetIntakeRunnerIdAttributeType) (ret UpdateIntakePayloadGetIntakeRunnerIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateIntakePayloadGetIntakeRunnerIdAttributeType(arg *UpdateIntakePayloadGetIntakeRunnerIdAttributeType, val UpdateIntakePayloadGetIntakeRunnerIdRetType) { + *arg = &val +} + +type UpdateIntakePayloadGetIntakeRunnerIdArgType = string +type UpdateIntakePayloadGetIntakeRunnerIdRetType = string + +/* + types and functions for labels +*/ + +// isContainer +type UpdateIntakePayloadGetLabelsAttributeType = *map[string]string +type UpdateIntakePayloadGetLabelsArgType = *map[string]string +type UpdateIntakePayloadGetLabelsRetType = *map[string]string + +func getUpdateIntakePayloadGetLabelsAttributeTypeOk(arg UpdateIntakePayloadGetLabelsAttributeType) (ret UpdateIntakePayloadGetLabelsRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg, true +} + +func setUpdateIntakePayloadGetLabelsAttributeType(arg *UpdateIntakePayloadGetLabelsAttributeType, val UpdateIntakePayloadGetLabelsRetType) { + *arg = val +} + +// UpdateIntakePayload struct for UpdateIntakePayload +type UpdateIntakePayload struct { + Catalog UpdateIntakePayloadGetCatalogAttributeType `json:"catalog,omitempty"` + // The description is a longer text chosen by the user to provide more context for the resource. + Description UpdateIntakePayloadGetDescriptionAttributeType `json:"description,omitempty"` + // The display name is a short name chosen by the user to identify the resource. + DisplayName UpdateIntakePayloadGetDisplayNameAttributeType `json:"displayName,omitempty"` + // The unique id of the intake runner this intake should run on. + // REQUIRED + IntakeRunnerId UpdateIntakePayloadGetIntakeRunnerIdAttributeType `json:"intakeRunnerId" required:"true"` + // Labels are key-value pairs associated with the resource. To update labels: - Provide a new set of key-value pairs to replace the existing labels. - Send empty object `{}` to remove all labels. - Omit this field to leave the labels unchanged. + Labels UpdateIntakePayloadGetLabelsAttributeType `json:"labels,omitempty"` +} + +type _UpdateIntakePayload UpdateIntakePayload + +// NewUpdateIntakePayload instantiates a new UpdateIntakePayload 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 NewUpdateIntakePayload(intakeRunnerId UpdateIntakePayloadGetIntakeRunnerIdArgType) *UpdateIntakePayload { + this := UpdateIntakePayload{} + setUpdateIntakePayloadGetIntakeRunnerIdAttributeType(&this.IntakeRunnerId, intakeRunnerId) + return &this +} + +// NewUpdateIntakePayloadWithDefaults instantiates a new UpdateIntakePayload 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 NewUpdateIntakePayloadWithDefaults() *UpdateIntakePayload { + this := UpdateIntakePayload{} + return &this +} + +// GetCatalog returns the Catalog field value if set, zero value otherwise. +func (o *UpdateIntakePayload) GetCatalog() (res UpdateIntakePayloadGetCatalogRetType) { + res, _ = o.GetCatalogOk() + return +} + +// GetCatalogOk returns a tuple with the Catalog field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateIntakePayload) GetCatalogOk() (ret UpdateIntakePayloadGetCatalogRetType, ok bool) { + return getUpdateIntakePayloadGetCatalogAttributeTypeOk(o.Catalog) +} + +// HasCatalog returns a boolean if a field has been set. +func (o *UpdateIntakePayload) HasCatalog() bool { + _, ok := o.GetCatalogOk() + return ok +} + +// SetCatalog gets a reference to the given IntakeCatalogPatch and assigns it to the Catalog field. +func (o *UpdateIntakePayload) SetCatalog(v UpdateIntakePayloadGetCatalogRetType) { + setUpdateIntakePayloadGetCatalogAttributeType(&o.Catalog, v) +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *UpdateIntakePayload) GetDescription() (res UpdateIntakePayloadGetDescriptionRetType) { + res, _ = o.GetDescriptionOk() + return +} + +// 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 *UpdateIntakePayload) GetDescriptionOk() (ret UpdateIntakePayloadGetDescriptionRetType, ok bool) { + return getUpdateIntakePayloadGetDescriptionAttributeTypeOk(o.Description) +} + +// HasDescription returns a boolean if a field has been set. +func (o *UpdateIntakePayload) HasDescription() bool { + _, ok := o.GetDescriptionOk() + return ok +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *UpdateIntakePayload) SetDescription(v UpdateIntakePayloadGetDescriptionRetType) { + setUpdateIntakePayloadGetDescriptionAttributeType(&o.Description, v) +} + +// GetDisplayName returns the DisplayName field value if set, zero value otherwise. +func (o *UpdateIntakePayload) GetDisplayName() (res UpdateIntakePayloadGetDisplayNameRetType) { + res, _ = o.GetDisplayNameOk() + return +} + +// GetDisplayNameOk returns a tuple with the DisplayName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateIntakePayload) GetDisplayNameOk() (ret UpdateIntakePayloadGetDisplayNameRetType, ok bool) { + return getUpdateIntakePayloadGetDisplayNameAttributeTypeOk(o.DisplayName) +} + +// HasDisplayName returns a boolean if a field has been set. +func (o *UpdateIntakePayload) HasDisplayName() bool { + _, ok := o.GetDisplayNameOk() + return ok +} + +// SetDisplayName gets a reference to the given string and assigns it to the DisplayName field. +func (o *UpdateIntakePayload) SetDisplayName(v UpdateIntakePayloadGetDisplayNameRetType) { + setUpdateIntakePayloadGetDisplayNameAttributeType(&o.DisplayName, v) +} + +// GetIntakeRunnerId returns the IntakeRunnerId field value +func (o *UpdateIntakePayload) GetIntakeRunnerId() (ret UpdateIntakePayloadGetIntakeRunnerIdRetType) { + ret, _ = o.GetIntakeRunnerIdOk() + return ret +} + +// GetIntakeRunnerIdOk returns a tuple with the IntakeRunnerId field value +// and a boolean to check if the value has been set. +func (o *UpdateIntakePayload) GetIntakeRunnerIdOk() (ret UpdateIntakePayloadGetIntakeRunnerIdRetType, ok bool) { + return getUpdateIntakePayloadGetIntakeRunnerIdAttributeTypeOk(o.IntakeRunnerId) +} + +// SetIntakeRunnerId sets field value +func (o *UpdateIntakePayload) SetIntakeRunnerId(v UpdateIntakePayloadGetIntakeRunnerIdRetType) { + setUpdateIntakePayloadGetIntakeRunnerIdAttributeType(&o.IntakeRunnerId, v) +} + +// GetLabels returns the Labels field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UpdateIntakePayload) GetLabels() (res UpdateIntakePayloadGetLabelsRetType) { + res, _ = o.GetLabelsOk() + return +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UpdateIntakePayload) GetLabelsOk() (ret UpdateIntakePayloadGetLabelsRetType, ok bool) { + return getUpdateIntakePayloadGetLabelsAttributeTypeOk(o.Labels) +} + +// HasLabels returns a boolean if a field has been set. +func (o *UpdateIntakePayload) HasLabels() bool { + _, ok := o.GetLabelsOk() + return ok +} + +// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. +func (o *UpdateIntakePayload) SetLabels(v UpdateIntakePayloadGetLabelsRetType) { + setUpdateIntakePayloadGetLabelsAttributeType(&o.Labels, v) +} + +func (o UpdateIntakePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getUpdateIntakePayloadGetCatalogAttributeTypeOk(o.Catalog); ok { + toSerialize["Catalog"] = val + } + if val, ok := getUpdateIntakePayloadGetDescriptionAttributeTypeOk(o.Description); ok { + toSerialize["Description"] = val + } + if val, ok := getUpdateIntakePayloadGetDisplayNameAttributeTypeOk(o.DisplayName); ok { + toSerialize["DisplayName"] = val + } + if val, ok := getUpdateIntakePayloadGetIntakeRunnerIdAttributeTypeOk(o.IntakeRunnerId); ok { + toSerialize["IntakeRunnerId"] = val + } + if val, ok := getUpdateIntakePayloadGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } + return toSerialize, nil +} + +type NullableUpdateIntakePayload struct { + value *UpdateIntakePayload + isSet bool +} + +func (v NullableUpdateIntakePayload) Get() *UpdateIntakePayload { + return v.value +} + +func (v *NullableUpdateIntakePayload) Set(val *UpdateIntakePayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateIntakePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateIntakePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateIntakePayload(val *UpdateIntakePayload) *NullableUpdateIntakePayload { + return &NullableUpdateIntakePayload{value: val, isSet: true} +} + +func (v NullableUpdateIntakePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateIntakePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/intake/model_update_intake_payload_test.go b/services/intake/model_update_intake_payload_test.go new file mode 100644 index 000000000..7a79462aa --- /dev/null +++ b/services/intake/model_update_intake_payload_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Intake API + +This API provides endpoints for managing Intakes. + +API version: 1beta.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package intake diff --git a/services/intake/model_update_intake_runner_payload.go b/services/intake/model_update_intake_runner_payload.go new file mode 100644 index 000000000..b33101508 --- /dev/null +++ b/services/intake/model_update_intake_runner_payload.go @@ -0,0 +1,317 @@ +/* +STACKIT Intake API + +This API provides endpoints for managing Intakes. + +API version: 1beta.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package intake + +import ( + "encoding/json" +) + +// checks if the UpdateIntakeRunnerPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateIntakeRunnerPayload{} + +/* + types and functions for description +*/ + +// isNotNullableString +type UpdateIntakeRunnerPayloadGetDescriptionAttributeType = *string + +func getUpdateIntakeRunnerPayloadGetDescriptionAttributeTypeOk(arg UpdateIntakeRunnerPayloadGetDescriptionAttributeType) (ret UpdateIntakeRunnerPayloadGetDescriptionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateIntakeRunnerPayloadGetDescriptionAttributeType(arg *UpdateIntakeRunnerPayloadGetDescriptionAttributeType, val UpdateIntakeRunnerPayloadGetDescriptionRetType) { + *arg = &val +} + +type UpdateIntakeRunnerPayloadGetDescriptionArgType = string +type UpdateIntakeRunnerPayloadGetDescriptionRetType = string + +/* + types and functions for displayName +*/ + +// isNotNullableString +type UpdateIntakeRunnerPayloadGetDisplayNameAttributeType = *string + +func getUpdateIntakeRunnerPayloadGetDisplayNameAttributeTypeOk(arg UpdateIntakeRunnerPayloadGetDisplayNameAttributeType) (ret UpdateIntakeRunnerPayloadGetDisplayNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateIntakeRunnerPayloadGetDisplayNameAttributeType(arg *UpdateIntakeRunnerPayloadGetDisplayNameAttributeType, val UpdateIntakeRunnerPayloadGetDisplayNameRetType) { + *arg = &val +} + +type UpdateIntakeRunnerPayloadGetDisplayNameArgType = string +type UpdateIntakeRunnerPayloadGetDisplayNameRetType = string + +/* + types and functions for labels +*/ + +// isContainer +type UpdateIntakeRunnerPayloadGetLabelsAttributeType = *map[string]string +type UpdateIntakeRunnerPayloadGetLabelsArgType = *map[string]string +type UpdateIntakeRunnerPayloadGetLabelsRetType = *map[string]string + +func getUpdateIntakeRunnerPayloadGetLabelsAttributeTypeOk(arg UpdateIntakeRunnerPayloadGetLabelsAttributeType) (ret UpdateIntakeRunnerPayloadGetLabelsRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg, true +} + +func setUpdateIntakeRunnerPayloadGetLabelsAttributeType(arg *UpdateIntakeRunnerPayloadGetLabelsAttributeType, val UpdateIntakeRunnerPayloadGetLabelsRetType) { + *arg = val +} + +/* + types and functions for maxMessageSizeKiB +*/ + +// isInteger +type UpdateIntakeRunnerPayloadGetMaxMessageSizeKiBAttributeType = *int64 +type UpdateIntakeRunnerPayloadGetMaxMessageSizeKiBArgType = int64 +type UpdateIntakeRunnerPayloadGetMaxMessageSizeKiBRetType = int64 + +func getUpdateIntakeRunnerPayloadGetMaxMessageSizeKiBAttributeTypeOk(arg UpdateIntakeRunnerPayloadGetMaxMessageSizeKiBAttributeType) (ret UpdateIntakeRunnerPayloadGetMaxMessageSizeKiBRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateIntakeRunnerPayloadGetMaxMessageSizeKiBAttributeType(arg *UpdateIntakeRunnerPayloadGetMaxMessageSizeKiBAttributeType, val UpdateIntakeRunnerPayloadGetMaxMessageSizeKiBRetType) { + *arg = &val +} + +/* + types and functions for maxMessagesPerHour +*/ + +// isInteger +type UpdateIntakeRunnerPayloadGetMaxMessagesPerHourAttributeType = *int64 +type UpdateIntakeRunnerPayloadGetMaxMessagesPerHourArgType = int64 +type UpdateIntakeRunnerPayloadGetMaxMessagesPerHourRetType = int64 + +func getUpdateIntakeRunnerPayloadGetMaxMessagesPerHourAttributeTypeOk(arg UpdateIntakeRunnerPayloadGetMaxMessagesPerHourAttributeType) (ret UpdateIntakeRunnerPayloadGetMaxMessagesPerHourRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateIntakeRunnerPayloadGetMaxMessagesPerHourAttributeType(arg *UpdateIntakeRunnerPayloadGetMaxMessagesPerHourAttributeType, val UpdateIntakeRunnerPayloadGetMaxMessagesPerHourRetType) { + *arg = &val +} + +// UpdateIntakeRunnerPayload struct for UpdateIntakeRunnerPayload +type UpdateIntakeRunnerPayload struct { + // The description is a longer text chosen by the user to provide more context for the resource. + Description UpdateIntakeRunnerPayloadGetDescriptionAttributeType `json:"description,omitempty"` + // The display name is a short name chosen by the user to identify the resource. + DisplayName UpdateIntakeRunnerPayloadGetDisplayNameAttributeType `json:"displayName,omitempty"` + // Labels are key-value pairs associated with the resource. To update labels: - Provide a new set of key-value pairs to replace the existing labels. - Send empty object `{}` to remove all labels. - Omit this field to leave the labels unchanged. + Labels UpdateIntakeRunnerPayloadGetLabelsAttributeType `json:"labels,omitempty"` + // The maximum size of a message in kibibytes (1 KiB = 1024 bytes). + // REQUIRED + MaxMessageSizeKiB UpdateIntakeRunnerPayloadGetMaxMessageSizeKiBAttributeType `json:"maxMessageSizeKiB" required:"true"` + // The maximum number of messages per hour. + // REQUIRED + MaxMessagesPerHour UpdateIntakeRunnerPayloadGetMaxMessagesPerHourAttributeType `json:"maxMessagesPerHour" required:"true"` +} + +type _UpdateIntakeRunnerPayload UpdateIntakeRunnerPayload + +// NewUpdateIntakeRunnerPayload instantiates a new UpdateIntakeRunnerPayload 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 NewUpdateIntakeRunnerPayload(maxMessageSizeKiB UpdateIntakeRunnerPayloadGetMaxMessageSizeKiBArgType, maxMessagesPerHour UpdateIntakeRunnerPayloadGetMaxMessagesPerHourArgType) *UpdateIntakeRunnerPayload { + this := UpdateIntakeRunnerPayload{} + setUpdateIntakeRunnerPayloadGetMaxMessageSizeKiBAttributeType(&this.MaxMessageSizeKiB, maxMessageSizeKiB) + setUpdateIntakeRunnerPayloadGetMaxMessagesPerHourAttributeType(&this.MaxMessagesPerHour, maxMessagesPerHour) + return &this +} + +// NewUpdateIntakeRunnerPayloadWithDefaults instantiates a new UpdateIntakeRunnerPayload 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 NewUpdateIntakeRunnerPayloadWithDefaults() *UpdateIntakeRunnerPayload { + this := UpdateIntakeRunnerPayload{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *UpdateIntakeRunnerPayload) GetDescription() (res UpdateIntakeRunnerPayloadGetDescriptionRetType) { + res, _ = o.GetDescriptionOk() + return +} + +// 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 *UpdateIntakeRunnerPayload) GetDescriptionOk() (ret UpdateIntakeRunnerPayloadGetDescriptionRetType, ok bool) { + return getUpdateIntakeRunnerPayloadGetDescriptionAttributeTypeOk(o.Description) +} + +// HasDescription returns a boolean if a field has been set. +func (o *UpdateIntakeRunnerPayload) HasDescription() bool { + _, ok := o.GetDescriptionOk() + return ok +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *UpdateIntakeRunnerPayload) SetDescription(v UpdateIntakeRunnerPayloadGetDescriptionRetType) { + setUpdateIntakeRunnerPayloadGetDescriptionAttributeType(&o.Description, v) +} + +// GetDisplayName returns the DisplayName field value if set, zero value otherwise. +func (o *UpdateIntakeRunnerPayload) GetDisplayName() (res UpdateIntakeRunnerPayloadGetDisplayNameRetType) { + res, _ = o.GetDisplayNameOk() + return +} + +// GetDisplayNameOk returns a tuple with the DisplayName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateIntakeRunnerPayload) GetDisplayNameOk() (ret UpdateIntakeRunnerPayloadGetDisplayNameRetType, ok bool) { + return getUpdateIntakeRunnerPayloadGetDisplayNameAttributeTypeOk(o.DisplayName) +} + +// HasDisplayName returns a boolean if a field has been set. +func (o *UpdateIntakeRunnerPayload) HasDisplayName() bool { + _, ok := o.GetDisplayNameOk() + return ok +} + +// SetDisplayName gets a reference to the given string and assigns it to the DisplayName field. +func (o *UpdateIntakeRunnerPayload) SetDisplayName(v UpdateIntakeRunnerPayloadGetDisplayNameRetType) { + setUpdateIntakeRunnerPayloadGetDisplayNameAttributeType(&o.DisplayName, v) +} + +// GetLabels returns the Labels field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UpdateIntakeRunnerPayload) GetLabels() (res UpdateIntakeRunnerPayloadGetLabelsRetType) { + res, _ = o.GetLabelsOk() + return +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UpdateIntakeRunnerPayload) GetLabelsOk() (ret UpdateIntakeRunnerPayloadGetLabelsRetType, ok bool) { + return getUpdateIntakeRunnerPayloadGetLabelsAttributeTypeOk(o.Labels) +} + +// HasLabels returns a boolean if a field has been set. +func (o *UpdateIntakeRunnerPayload) HasLabels() bool { + _, ok := o.GetLabelsOk() + return ok +} + +// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. +func (o *UpdateIntakeRunnerPayload) SetLabels(v UpdateIntakeRunnerPayloadGetLabelsRetType) { + setUpdateIntakeRunnerPayloadGetLabelsAttributeType(&o.Labels, v) +} + +// GetMaxMessageSizeKiB returns the MaxMessageSizeKiB field value +func (o *UpdateIntakeRunnerPayload) GetMaxMessageSizeKiB() (ret UpdateIntakeRunnerPayloadGetMaxMessageSizeKiBRetType) { + ret, _ = o.GetMaxMessageSizeKiBOk() + return ret +} + +// GetMaxMessageSizeKiBOk returns a tuple with the MaxMessageSizeKiB field value +// and a boolean to check if the value has been set. +func (o *UpdateIntakeRunnerPayload) GetMaxMessageSizeKiBOk() (ret UpdateIntakeRunnerPayloadGetMaxMessageSizeKiBRetType, ok bool) { + return getUpdateIntakeRunnerPayloadGetMaxMessageSizeKiBAttributeTypeOk(o.MaxMessageSizeKiB) +} + +// SetMaxMessageSizeKiB sets field value +func (o *UpdateIntakeRunnerPayload) SetMaxMessageSizeKiB(v UpdateIntakeRunnerPayloadGetMaxMessageSizeKiBRetType) { + setUpdateIntakeRunnerPayloadGetMaxMessageSizeKiBAttributeType(&o.MaxMessageSizeKiB, v) +} + +// GetMaxMessagesPerHour returns the MaxMessagesPerHour field value +func (o *UpdateIntakeRunnerPayload) GetMaxMessagesPerHour() (ret UpdateIntakeRunnerPayloadGetMaxMessagesPerHourRetType) { + ret, _ = o.GetMaxMessagesPerHourOk() + return ret +} + +// GetMaxMessagesPerHourOk returns a tuple with the MaxMessagesPerHour field value +// and a boolean to check if the value has been set. +func (o *UpdateIntakeRunnerPayload) GetMaxMessagesPerHourOk() (ret UpdateIntakeRunnerPayloadGetMaxMessagesPerHourRetType, ok bool) { + return getUpdateIntakeRunnerPayloadGetMaxMessagesPerHourAttributeTypeOk(o.MaxMessagesPerHour) +} + +// SetMaxMessagesPerHour sets field value +func (o *UpdateIntakeRunnerPayload) SetMaxMessagesPerHour(v UpdateIntakeRunnerPayloadGetMaxMessagesPerHourRetType) { + setUpdateIntakeRunnerPayloadGetMaxMessagesPerHourAttributeType(&o.MaxMessagesPerHour, v) +} + +func (o UpdateIntakeRunnerPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getUpdateIntakeRunnerPayloadGetDescriptionAttributeTypeOk(o.Description); ok { + toSerialize["Description"] = val + } + if val, ok := getUpdateIntakeRunnerPayloadGetDisplayNameAttributeTypeOk(o.DisplayName); ok { + toSerialize["DisplayName"] = val + } + if val, ok := getUpdateIntakeRunnerPayloadGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } + if val, ok := getUpdateIntakeRunnerPayloadGetMaxMessageSizeKiBAttributeTypeOk(o.MaxMessageSizeKiB); ok { + toSerialize["MaxMessageSizeKiB"] = val + } + if val, ok := getUpdateIntakeRunnerPayloadGetMaxMessagesPerHourAttributeTypeOk(o.MaxMessagesPerHour); ok { + toSerialize["MaxMessagesPerHour"] = val + } + return toSerialize, nil +} + +type NullableUpdateIntakeRunnerPayload struct { + value *UpdateIntakeRunnerPayload + isSet bool +} + +func (v NullableUpdateIntakeRunnerPayload) Get() *UpdateIntakeRunnerPayload { + return v.value +} + +func (v *NullableUpdateIntakeRunnerPayload) Set(val *UpdateIntakeRunnerPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateIntakeRunnerPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateIntakeRunnerPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateIntakeRunnerPayload(val *UpdateIntakeRunnerPayload) *NullableUpdateIntakeRunnerPayload { + return &NullableUpdateIntakeRunnerPayload{value: val, isSet: true} +} + +func (v NullableUpdateIntakeRunnerPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateIntakeRunnerPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/intake/model_update_intake_runner_payload_test.go b/services/intake/model_update_intake_runner_payload_test.go new file mode 100644 index 000000000..7a79462aa --- /dev/null +++ b/services/intake/model_update_intake_runner_payload_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Intake API + +This API provides endpoints for managing Intakes. + +API version: 1beta.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package intake diff --git a/services/intake/model_update_intake_user_payload.go b/services/intake/model_update_intake_user_payload.go new file mode 100644 index 000000000..7a2dfdf01 --- /dev/null +++ b/services/intake/model_update_intake_user_payload.go @@ -0,0 +1,325 @@ +/* +STACKIT Intake API + +This API provides endpoints for managing Intakes. + +API version: 1beta.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package intake + +import ( + "encoding/json" +) + +// checks if the UpdateIntakeUserPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateIntakeUserPayload{} + +/* + types and functions for description +*/ + +// isNotNullableString +type UpdateIntakeUserPayloadGetDescriptionAttributeType = *string + +func getUpdateIntakeUserPayloadGetDescriptionAttributeTypeOk(arg UpdateIntakeUserPayloadGetDescriptionAttributeType) (ret UpdateIntakeUserPayloadGetDescriptionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateIntakeUserPayloadGetDescriptionAttributeType(arg *UpdateIntakeUserPayloadGetDescriptionAttributeType, val UpdateIntakeUserPayloadGetDescriptionRetType) { + *arg = &val +} + +type UpdateIntakeUserPayloadGetDescriptionArgType = string +type UpdateIntakeUserPayloadGetDescriptionRetType = string + +/* + types and functions for displayName +*/ + +// isNotNullableString +type UpdateIntakeUserPayloadGetDisplayNameAttributeType = *string + +func getUpdateIntakeUserPayloadGetDisplayNameAttributeTypeOk(arg UpdateIntakeUserPayloadGetDisplayNameAttributeType) (ret UpdateIntakeUserPayloadGetDisplayNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateIntakeUserPayloadGetDisplayNameAttributeType(arg *UpdateIntakeUserPayloadGetDisplayNameAttributeType, val UpdateIntakeUserPayloadGetDisplayNameRetType) { + *arg = &val +} + +type UpdateIntakeUserPayloadGetDisplayNameArgType = string +type UpdateIntakeUserPayloadGetDisplayNameRetType = string + +/* + types and functions for labels +*/ + +// isContainer +type UpdateIntakeUserPayloadGetLabelsAttributeType = *map[string]string +type UpdateIntakeUserPayloadGetLabelsArgType = *map[string]string +type UpdateIntakeUserPayloadGetLabelsRetType = *map[string]string + +func getUpdateIntakeUserPayloadGetLabelsAttributeTypeOk(arg UpdateIntakeUserPayloadGetLabelsAttributeType) (ret UpdateIntakeUserPayloadGetLabelsRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg, true +} + +func setUpdateIntakeUserPayloadGetLabelsAttributeType(arg *UpdateIntakeUserPayloadGetLabelsAttributeType, val UpdateIntakeUserPayloadGetLabelsRetType) { + *arg = val +} + +/* + types and functions for password +*/ + +// isNotNullableString +type UpdateIntakeUserPayloadGetPasswordAttributeType = *string + +func getUpdateIntakeUserPayloadGetPasswordAttributeTypeOk(arg UpdateIntakeUserPayloadGetPasswordAttributeType) (ret UpdateIntakeUserPayloadGetPasswordRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateIntakeUserPayloadGetPasswordAttributeType(arg *UpdateIntakeUserPayloadGetPasswordAttributeType, val UpdateIntakeUserPayloadGetPasswordRetType) { + *arg = &val +} + +type UpdateIntakeUserPayloadGetPasswordArgType = string +type UpdateIntakeUserPayloadGetPasswordRetType = string + +/* + types and functions for type +*/ + +// isEnumRef +type UpdateIntakeUserPayloadGetTypeAttributeType = *UserType +type UpdateIntakeUserPayloadGetTypeArgType = UserType +type UpdateIntakeUserPayloadGetTypeRetType = UserType + +func getUpdateIntakeUserPayloadGetTypeAttributeTypeOk(arg UpdateIntakeUserPayloadGetTypeAttributeType) (ret UpdateIntakeUserPayloadGetTypeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateIntakeUserPayloadGetTypeAttributeType(arg *UpdateIntakeUserPayloadGetTypeAttributeType, val UpdateIntakeUserPayloadGetTypeRetType) { + *arg = &val +} + +// UpdateIntakeUserPayload struct for UpdateIntakeUserPayload +type UpdateIntakeUserPayload struct { + // The description is a longer text chosen by the user to provide more context for the resource. + Description UpdateIntakeUserPayloadGetDescriptionAttributeType `json:"description,omitempty"` + // The display name is a short name chosen by the user to identify the resource. + DisplayName UpdateIntakeUserPayloadGetDisplayNameAttributeType `json:"displayName,omitempty"` + // Labels are key-value pairs associated with the resource. To update labels: - Provide a new set of key-value pairs to replace the existing labels. - Send empty object `{}` to remove all labels. - Omit this field to leave the labels unchanged. + Labels UpdateIntakeUserPayloadGetLabelsAttributeType `json:"labels,omitempty"` + // A password chosen by the user. + Password UpdateIntakeUserPayloadGetPasswordAttributeType `json:"password,omitempty"` + Type UpdateIntakeUserPayloadGetTypeAttributeType `json:"type,omitempty"` +} + +// NewUpdateIntakeUserPayload instantiates a new UpdateIntakeUserPayload 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 NewUpdateIntakeUserPayload() *UpdateIntakeUserPayload { + this := UpdateIntakeUserPayload{} + return &this +} + +// NewUpdateIntakeUserPayloadWithDefaults instantiates a new UpdateIntakeUserPayload 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 NewUpdateIntakeUserPayloadWithDefaults() *UpdateIntakeUserPayload { + this := UpdateIntakeUserPayload{} + var types UserType = USERTYPE_INTAKE + this.Type = &types + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *UpdateIntakeUserPayload) GetDescription() (res UpdateIntakeUserPayloadGetDescriptionRetType) { + res, _ = o.GetDescriptionOk() + return +} + +// 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 *UpdateIntakeUserPayload) GetDescriptionOk() (ret UpdateIntakeUserPayloadGetDescriptionRetType, ok bool) { + return getUpdateIntakeUserPayloadGetDescriptionAttributeTypeOk(o.Description) +} + +// HasDescription returns a boolean if a field has been set. +func (o *UpdateIntakeUserPayload) HasDescription() bool { + _, ok := o.GetDescriptionOk() + return ok +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *UpdateIntakeUserPayload) SetDescription(v UpdateIntakeUserPayloadGetDescriptionRetType) { + setUpdateIntakeUserPayloadGetDescriptionAttributeType(&o.Description, v) +} + +// GetDisplayName returns the DisplayName field value if set, zero value otherwise. +func (o *UpdateIntakeUserPayload) GetDisplayName() (res UpdateIntakeUserPayloadGetDisplayNameRetType) { + res, _ = o.GetDisplayNameOk() + return +} + +// GetDisplayNameOk returns a tuple with the DisplayName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateIntakeUserPayload) GetDisplayNameOk() (ret UpdateIntakeUserPayloadGetDisplayNameRetType, ok bool) { + return getUpdateIntakeUserPayloadGetDisplayNameAttributeTypeOk(o.DisplayName) +} + +// HasDisplayName returns a boolean if a field has been set. +func (o *UpdateIntakeUserPayload) HasDisplayName() bool { + _, ok := o.GetDisplayNameOk() + return ok +} + +// SetDisplayName gets a reference to the given string and assigns it to the DisplayName field. +func (o *UpdateIntakeUserPayload) SetDisplayName(v UpdateIntakeUserPayloadGetDisplayNameRetType) { + setUpdateIntakeUserPayloadGetDisplayNameAttributeType(&o.DisplayName, v) +} + +// GetLabels returns the Labels field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UpdateIntakeUserPayload) GetLabels() (res UpdateIntakeUserPayloadGetLabelsRetType) { + res, _ = o.GetLabelsOk() + return +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UpdateIntakeUserPayload) GetLabelsOk() (ret UpdateIntakeUserPayloadGetLabelsRetType, ok bool) { + return getUpdateIntakeUserPayloadGetLabelsAttributeTypeOk(o.Labels) +} + +// HasLabels returns a boolean if a field has been set. +func (o *UpdateIntakeUserPayload) HasLabels() bool { + _, ok := o.GetLabelsOk() + return ok +} + +// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. +func (o *UpdateIntakeUserPayload) SetLabels(v UpdateIntakeUserPayloadGetLabelsRetType) { + setUpdateIntakeUserPayloadGetLabelsAttributeType(&o.Labels, v) +} + +// GetPassword returns the Password field value if set, zero value otherwise. +func (o *UpdateIntakeUserPayload) GetPassword() (res UpdateIntakeUserPayloadGetPasswordRetType) { + res, _ = o.GetPasswordOk() + return +} + +// GetPasswordOk returns a tuple with the Password field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateIntakeUserPayload) GetPasswordOk() (ret UpdateIntakeUserPayloadGetPasswordRetType, ok bool) { + return getUpdateIntakeUserPayloadGetPasswordAttributeTypeOk(o.Password) +} + +// HasPassword returns a boolean if a field has been set. +func (o *UpdateIntakeUserPayload) HasPassword() bool { + _, ok := o.GetPasswordOk() + return ok +} + +// SetPassword gets a reference to the given string and assigns it to the Password field. +func (o *UpdateIntakeUserPayload) SetPassword(v UpdateIntakeUserPayloadGetPasswordRetType) { + setUpdateIntakeUserPayloadGetPasswordAttributeType(&o.Password, v) +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *UpdateIntakeUserPayload) GetType() (res UpdateIntakeUserPayloadGetTypeRetType) { + res, _ = o.GetTypeOk() + return +} + +// 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 *UpdateIntakeUserPayload) GetTypeOk() (ret UpdateIntakeUserPayloadGetTypeRetType, ok bool) { + return getUpdateIntakeUserPayloadGetTypeAttributeTypeOk(o.Type) +} + +// HasType returns a boolean if a field has been set. +func (o *UpdateIntakeUserPayload) HasType() bool { + _, ok := o.GetTypeOk() + return ok +} + +// SetType gets a reference to the given UserType and assigns it to the Type field. +func (o *UpdateIntakeUserPayload) SetType(v UpdateIntakeUserPayloadGetTypeRetType) { + setUpdateIntakeUserPayloadGetTypeAttributeType(&o.Type, v) +} + +func (o UpdateIntakeUserPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getUpdateIntakeUserPayloadGetDescriptionAttributeTypeOk(o.Description); ok { + toSerialize["Description"] = val + } + if val, ok := getUpdateIntakeUserPayloadGetDisplayNameAttributeTypeOk(o.DisplayName); ok { + toSerialize["DisplayName"] = val + } + if val, ok := getUpdateIntakeUserPayloadGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } + if val, ok := getUpdateIntakeUserPayloadGetPasswordAttributeTypeOk(o.Password); ok { + toSerialize["Password"] = val + } + if val, ok := getUpdateIntakeUserPayloadGetTypeAttributeTypeOk(o.Type); ok { + toSerialize["Type"] = val + } + return toSerialize, nil +} + +type NullableUpdateIntakeUserPayload struct { + value *UpdateIntakeUserPayload + isSet bool +} + +func (v NullableUpdateIntakeUserPayload) Get() *UpdateIntakeUserPayload { + return v.value +} + +func (v *NullableUpdateIntakeUserPayload) Set(val *UpdateIntakeUserPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateIntakeUserPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateIntakeUserPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateIntakeUserPayload(val *UpdateIntakeUserPayload) *NullableUpdateIntakeUserPayload { + return &NullableUpdateIntakeUserPayload{value: val, isSet: true} +} + +func (v NullableUpdateIntakeUserPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateIntakeUserPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/intake/model_update_intake_user_payload_test.go b/services/intake/model_update_intake_user_payload_test.go new file mode 100644 index 000000000..7a79462aa --- /dev/null +++ b/services/intake/model_update_intake_user_payload_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Intake API + +This API provides endpoints for managing Intakes. + +API version: 1beta.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package intake diff --git a/services/intake/model_user_type.go b/services/intake/model_user_type.go new file mode 100644 index 000000000..1c999767d --- /dev/null +++ b/services/intake/model_user_type.go @@ -0,0 +1,115 @@ +/* +STACKIT Intake API + +This API provides endpoints for managing Intakes. + +API version: 1beta.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package intake + +import ( + "encoding/json" + "fmt" +) + +// UserType Type of user, 'intake' allows writing to the Intake, 'dead-letter' allows reading from the dead-letter queue +type UserType string + +// List of userType +const ( + USERTYPE_INTAKE UserType = "intake" + USERTYPE_DEAD_LETTER UserType = "dead-letter" +) + +// All allowed values of UserType enum +var AllowedUserTypeEnumValues = []UserType{ + "intake", + "dead-letter", +} + +func (v *UserType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + // Allow unmarshalling zero value for testing purposes + var zeroValue string + if value == zeroValue { + return nil + } + enumTypeValue := UserType(value) + for _, existing := range AllowedUserTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid UserType", value) +} + +// NewUserTypeFromValue returns a pointer to a valid UserType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewUserTypeFromValue(v string) (*UserType, error) { + ev := UserType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for UserType: valid values are %v", v, AllowedUserTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v UserType) IsValid() bool { + for _, existing := range AllowedUserTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to userType value +func (v UserType) Ptr() *UserType { + return &v +} + +type NullableUserType struct { + value *UserType + isSet bool +} + +func (v NullableUserType) Get() *UserType { + return v.value +} + +func (v *NullableUserType) Set(val *UserType) { + v.value = val + v.isSet = true +} + +func (v NullableUserType) IsSet() bool { + return v.isSet +} + +func (v *NullableUserType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserType(val *UserType) *NullableUserType { + return &NullableUserType{value: val, isSet: true} +} + +func (v NullableUserType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/intake/model_user_type_test.go b/services/intake/model_user_type_test.go new file mode 100644 index 000000000..7a79462aa --- /dev/null +++ b/services/intake/model_user_type_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Intake API + +This API provides endpoints for managing Intakes. + +API version: 1beta.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package intake diff --git a/services/intake/utils.go b/services/intake/utils.go new file mode 100644 index 000000000..40db626d2 --- /dev/null +++ b/services/intake/utils.go @@ -0,0 +1,385 @@ +/* +STACKIT Intake API + +This API provides endpoints for managing Intakes. + +API version: 1beta.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package intake + +import ( + "encoding/json" + "math/rand" + "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 NullableValue[T any] struct { + value *T + isSet bool +} + +func (v NullableValue[T]) Get() *T { + return v.value +} + +func (v *NullableValue[T]) Set(val *T) { + v.value = val + v.isSet = true +} + +func (v NullableValue[T]) IsSet() bool { + return v.isSet +} + +func (v *NullableValue[T]) Unset() { + v.value = nil + v.isSet = false +} + +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 + } + if t, ok := i.(interface{ IsSet() bool }); ok { + return !t.IsSet() + } + 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) +} + +const letterRunes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" + +// randString returns a random string with a specified length. It panics if n <= 0. +func randString(n int) string { + b := make([]byte, n) + for i := range b { + b[i] = letterRunes[rand.Intn(len(letterRunes))] + } + return string(b) +}