feat: auto generated files and new structure (#4)
Some checks failed
Publish / Check GoReleaser config (push) Successful in 4s
Release / goreleaser (push) Failing after 29s
Publish / Publish provider (push) Failing after 4m24s

## Description

<!-- **Please link some issue here describing what you are trying to achieve.**

In case there is no issue present for your PR, please consider creating one.
At least please give us some description what you are trying to achieve and why your change is needed. -->

relates to #1234

## Checklist

- [ ] Issue was linked above
- [ ] Code format was applied: `make fmt`
- [ ] Examples were added / adjusted (see `examples/` directory)
- [x] Docs are up-to-date: `make generate-docs` (will be checked by CI)
- [ ] Unit tests got implemented or updated
- [ ] Acceptance tests got implemented or updated (see e.g. [here](f5f99d1709/stackit/internal/services/dns/dns_acc_test.go))
- [x] Unit tests are passing: `make test` (will be checked by CI)
- [x] No linter issues: `make lint` (will be checked by CI)

Reviewed-on: #4
Reviewed-by: Andre_Harms <andre.harms@stackit.cloud>
Co-authored-by: Marcel S. Henselin <marcel.henselin@stackit.cloud>
Co-committed-by: Marcel S. Henselin <marcel.henselin@stackit.cloud>
This commit is contained in:
Marcel S. Henselin 2026-01-29 14:10:25 +00:00 committed by Marcel_Henselin
parent 979220be66
commit 9f41c4da7f
Signed by: tf-provider.git.onstackit.cloud
GPG key ID: 6D7E8A1ED8955A9C
1283 changed files with 273211 additions and 4614 deletions

View file

@ -0,0 +1 @@
6.6.0

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,882 @@
/*
STACKIT Intake API
Testing DefaultApiService
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech);
package intakebeta
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_intakebeta_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 intakebeta_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 intakebeta_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 intakebeta_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 intakebeta_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 intakebeta_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 intakebeta_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 intakebeta_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 intakebeta_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 intakebeta_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 intakebeta_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 intakebeta_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 intakebeta_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 intakebeta_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) {
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 intakebeta_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{}
resp, reqErr := apiClient.UpdateIntakeRunner(context.Background(), projectId, regionId, intakeRunnerId).UpdateIntakeRunnerPayload(updateIntakeRunnerPayload).Execute()
if reqErr != nil {
t.Fatalf("error in call: %v", reqErr)
}
if IsNil(resp) {
t.Fatalf("response not present")
}
})
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) {
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 intakebeta_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{}
resp, reqErr := apiClient.UpdateIntakeUser(context.Background(), projectId, regionId, intakeId, intakeUserId).UpdateIntakeUserPayload(updateIntakeUserPayload).Execute()
if reqErr != nil {
t.Fatalf("error in call: %v", reqErr)
}
if IsNil(resp) {
t.Fatalf("response not present")
}
})
}

628
pkg/intakebeta/client.go Normal file
View file

@ -0,0 +1,628 @@
/*
STACKIT Intake API
This API provides endpoints for managing Intakes.
API version: 1beta.3.5
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package intakebeta
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.3.5
// 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
}
defer file.Close()
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)
}

View file

@ -0,0 +1,41 @@
/*
STACKIT Intake API
This API provides endpoints for managing Intakes.
API version: 1beta.3.5
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package intakebeta
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/intakebeta",
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
}

View file

@ -0,0 +1,172 @@
/*
STACKIT Intake API
This API provides endpoints for managing Intakes.
API version: 1beta.3.5
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package intakebeta
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)
}

View file

@ -0,0 +1,174 @@
/*
STACKIT Intake API
This API provides endpoints for managing Intakes.
API version: 1beta.3.5
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package intakebeta
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)
}

View file

@ -0,0 +1,11 @@
/*
STACKIT Intake API
This API provides endpoints for managing Intakes.
API version: 1beta.3.5
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package intakebeta

View file

@ -0,0 +1,11 @@
/*
STACKIT Intake API
This API provides endpoints for managing Intakes.
API version: 1beta.3.5
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package intakebeta

View file

@ -0,0 +1,115 @@
/*
STACKIT Intake API
This API provides endpoints for managing Intakes.
API version: 1beta.3.5
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package intakebeta
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)
}

View file

@ -0,0 +1,11 @@
/*
STACKIT Intake API
This API provides endpoints for managing Intakes.
API version: 1beta.3.5
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package intakebeta

View file

@ -0,0 +1,172 @@
/*
STACKIT Intake API
This API provides endpoints for managing Intakes.
API version: 1beta.3.5
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package intakebeta
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)
}

View file

@ -0,0 +1,11 @@
/*
STACKIT Intake API
This API provides endpoints for managing Intakes.
API version: 1beta.3.5
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package intakebeta

View file

@ -0,0 +1,313 @@
/*
STACKIT Intake API
This API provides endpoints for managing Intakes.
API version: 1beta.3.5
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package intakebeta
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)
}

View file

@ -0,0 +1,11 @@
/*
STACKIT Intake API
This API provides endpoints for managing Intakes.
API version: 1beta.3.5
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package intakebeta

View file

@ -0,0 +1,313 @@
/*
STACKIT Intake API
This API provides endpoints for managing Intakes.
API version: 1beta.3.5
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package intakebeta
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)
}

View file

@ -0,0 +1,11 @@
/*
STACKIT Intake API
This API provides endpoints for managing Intakes.
API version: 1beta.3.5
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package intakebeta

View file

@ -0,0 +1,319 @@
/*
STACKIT Intake API
This API provides endpoints for managing Intakes.
API version: 1beta.3.5
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package intakebeta
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. The password must consist of at least of each of these categories: * lower case letter * upper case letter * number * other character
// 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)
}

View file

@ -0,0 +1,11 @@
/*
STACKIT Intake API
This API provides endpoints for managing Intakes.
API version: 1beta.3.5
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package intakebeta

View file

@ -0,0 +1,172 @@
/*
STACKIT Intake API
This API provides endpoints for managing Intakes.
API version: 1beta.3.5
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package intakebeta
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)
}

View file

@ -0,0 +1,178 @@
/*
STACKIT Intake API
This API provides endpoints for managing Intakes.
API version: 1beta.3.5
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package intakebeta
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)
}

View file

@ -0,0 +1,11 @@
/*
STACKIT Intake API
This API provides endpoints for managing Intakes.
API version: 1beta.3.5
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package intakebeta

View file

@ -0,0 +1,11 @@
/*
STACKIT Intake API
This API provides endpoints for managing Intakes.
API version: 1beta.3.5
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package intakebeta

View file

@ -0,0 +1,417 @@
/*
STACKIT Intake API
This API provides endpoints for managing Intakes.
API version: 1beta.3.5
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package intakebeta
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 partitioning
*/
// isEnumRef
type IntakeCatalogGetPartitioningAttributeType = *PartitioningType
type IntakeCatalogGetPartitioningArgType = PartitioningType
type IntakeCatalogGetPartitioningRetType = PartitioningType
func getIntakeCatalogGetPartitioningAttributeTypeOk(arg IntakeCatalogGetPartitioningAttributeType) (ret IntakeCatalogGetPartitioningRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setIntakeCatalogGetPartitioningAttributeType(arg *IntakeCatalogGetPartitioningAttributeType, val IntakeCatalogGetPartitioningRetType) {
*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"`
// List of Iceberg partitioning expressions to use when creating the target table. This setting can only be used when `partitioning` is set to `manual`. Partitioning configuration of an Intake can be changed after creation, but will only take effect once the table has been changed as well. In case of not updating the table to a new one, the old partitioning configuration will remain. See the [Apache Iceberg spec](https://iceberg.apache.org/spec/#partitioning) for more details.
PartitionBy IntakeCatalogGetPartitionByAttributeType `json:"partitionBy,omitempty"`
Partitioning IntakeCatalogGetPartitioningAttributeType `json:"partitioning,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
var partitioning PartitioningType = PARTITIONINGTYPE_NONE
this.Partitioning = &partitioning
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)
}
// GetPartitioning returns the Partitioning field value if set, zero value otherwise.
func (o *IntakeCatalog) GetPartitioning() (res IntakeCatalogGetPartitioningRetType) {
res, _ = o.GetPartitioningOk()
return
}
// GetPartitioningOk returns a tuple with the Partitioning field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IntakeCatalog) GetPartitioningOk() (ret IntakeCatalogGetPartitioningRetType, ok bool) {
return getIntakeCatalogGetPartitioningAttributeTypeOk(o.Partitioning)
}
// HasPartitioning returns a boolean if a field has been set.
func (o *IntakeCatalog) HasPartitioning() bool {
_, ok := o.GetPartitioningOk()
return ok
}
// SetPartitioning gets a reference to the given PartitioningType and assigns it to the Partitioning field.
func (o *IntakeCatalog) SetPartitioning(v IntakeCatalogGetPartitioningRetType) {
setIntakeCatalogGetPartitioningAttributeType(&o.Partitioning, 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 := getIntakeCatalogGetPartitioningAttributeTypeOk(o.Partitioning); ok {
toSerialize["Partitioning"] = 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)
}

View file

@ -0,0 +1,421 @@
/*
STACKIT Intake API
This API provides endpoints for managing Intakes.
API version: 1beta.3.5
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package intakebeta
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 partitionBy
*/
// isArray
type IntakeCatalogPatchGetPartitionByAttributeType = *[]string
type IntakeCatalogPatchGetPartitionByArgType = *[]string
type IntakeCatalogPatchGetPartitionByRetType = *[]string
func getIntakeCatalogPatchGetPartitionByAttributeTypeOk(arg IntakeCatalogPatchGetPartitionByAttributeType) (ret IntakeCatalogPatchGetPartitionByRetType, ok bool) {
if arg == nil {
return nil, false
}
return arg, true
}
func setIntakeCatalogPatchGetPartitionByAttributeType(arg *IntakeCatalogPatchGetPartitionByAttributeType, val IntakeCatalogPatchGetPartitionByRetType) {
*arg = val
}
/*
types and functions for partitioning
*/
// isEnumRef
type IntakeCatalogPatchGetPartitioningAttributeType = *PartitioningUpdateType
type IntakeCatalogPatchGetPartitioningArgType = PartitioningUpdateType
type IntakeCatalogPatchGetPartitioningRetType = PartitioningUpdateType
func getIntakeCatalogPatchGetPartitioningAttributeTypeOk(arg IntakeCatalogPatchGetPartitioningAttributeType) (ret IntakeCatalogPatchGetPartitioningRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setIntakeCatalogPatchGetPartitioningAttributeType(arg *IntakeCatalogPatchGetPartitioningAttributeType, val IntakeCatalogPatchGetPartitioningRetType) {
*arg = &val
}
/*
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"`
// List of Iceberg partitioning expressions to use when creating the target table. This setting can only be used when `partitioning` is set to `manual`. See the [Apache Iceberg spec](https://iceberg.apache.org/spec/#partitioning) for more details.
PartitionBy IntakeCatalogPatchGetPartitionByAttributeType `json:"partitionBy,omitempty"`
Partitioning IntakeCatalogPatchGetPartitioningAttributeType `json:"partitioning,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)
}
// GetPartitionBy returns the PartitionBy field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *IntakeCatalogPatch) GetPartitionBy() (res IntakeCatalogPatchGetPartitionByRetType) {
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 *IntakeCatalogPatch) GetPartitionByOk() (ret IntakeCatalogPatchGetPartitionByRetType, ok bool) {
return getIntakeCatalogPatchGetPartitionByAttributeTypeOk(o.PartitionBy)
}
// HasPartitionBy returns a boolean if a field has been set.
func (o *IntakeCatalogPatch) HasPartitionBy() bool {
_, ok := o.GetPartitionByOk()
return ok
}
// SetPartitionBy gets a reference to the given []string and assigns it to the PartitionBy field.
func (o *IntakeCatalogPatch) SetPartitionBy(v IntakeCatalogPatchGetPartitionByRetType) {
setIntakeCatalogPatchGetPartitionByAttributeType(&o.PartitionBy, v)
}
// GetPartitioning returns the Partitioning field value if set, zero value otherwise.
func (o *IntakeCatalogPatch) GetPartitioning() (res IntakeCatalogPatchGetPartitioningRetType) {
res, _ = o.GetPartitioningOk()
return
}
// GetPartitioningOk returns a tuple with the Partitioning field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IntakeCatalogPatch) GetPartitioningOk() (ret IntakeCatalogPatchGetPartitioningRetType, ok bool) {
return getIntakeCatalogPatchGetPartitioningAttributeTypeOk(o.Partitioning)
}
// HasPartitioning returns a boolean if a field has been set.
func (o *IntakeCatalogPatch) HasPartitioning() bool {
_, ok := o.GetPartitioningOk()
return ok
}
// SetPartitioning gets a reference to the given PartitioningUpdateType and assigns it to the Partitioning field.
func (o *IntakeCatalogPatch) SetPartitioning(v IntakeCatalogPatchGetPartitioningRetType) {
setIntakeCatalogPatchGetPartitioningAttributeType(&o.Partitioning, 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 := getIntakeCatalogPatchGetPartitionByAttributeTypeOk(o.PartitionBy); ok {
toSerialize["PartitionBy"] = val
}
if val, ok := getIntakeCatalogPatchGetPartitioningAttributeTypeOk(o.Partitioning); ok {
toSerialize["Partitioning"] = 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)
}

View file

@ -0,0 +1,11 @@
/*
STACKIT Intake API
This API provides endpoints for managing Intakes.
API version: 1beta.3.5
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package intakebeta

View file

@ -0,0 +1,11 @@
/*
STACKIT Intake API
This API provides endpoints for managing Intakes.
API version: 1beta.3.5
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package intakebeta

View file

@ -0,0 +1,788 @@
/*
STACKIT Intake API
This API provides endpoints for managing Intakes.
API version: 1beta.3.5
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package intakebeta
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)
}

View file

@ -0,0 +1,72 @@
/*
STACKIT Intake API
This API provides endpoints for managing Intakes.
API version: 1beta.3.5
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package intakebeta
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)
}
})
}
}

View file

@ -0,0 +1,599 @@
/*
STACKIT Intake API
This API provides endpoints for managing Intakes.
API version: 1beta.3.5
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package intakebeta
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)
}

View file

@ -0,0 +1,65 @@
/*
STACKIT Intake API
This API provides endpoints for managing Intakes.
API version: 1beta.3.5
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package intakebeta
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)
}
})
}
}

View file

@ -0,0 +1,603 @@
/*
STACKIT Intake API
This API provides endpoints for managing Intakes.
API version: 1beta.3.5
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package intakebeta
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)
}

View file

@ -0,0 +1,65 @@
/*
STACKIT Intake API
This API provides endpoints for managing Intakes.
API version: 1beta.3.5
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package intakebeta
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)
}
})
}
}

View file

@ -0,0 +1,174 @@
/*
STACKIT Intake API
This API provides endpoints for managing Intakes.
API version: 1beta.3.5
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package intakebeta
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)
}

View file

@ -0,0 +1,11 @@
/*
STACKIT Intake API
This API provides endpoints for managing Intakes.
API version: 1beta.3.5
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package intakebeta

View file

@ -0,0 +1,174 @@
/*
STACKIT Intake API
This API provides endpoints for managing Intakes.
API version: 1beta.3.5
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package intakebeta
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)
}

View file

@ -0,0 +1,11 @@
/*
STACKIT Intake API
This API provides endpoints for managing Intakes.
API version: 1beta.3.5
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package intakebeta

View file

@ -0,0 +1,174 @@
/*
STACKIT Intake API
This API provides endpoints for managing Intakes.
API version: 1beta.3.5
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package intakebeta
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)
}

View file

@ -0,0 +1,11 @@
/*
STACKIT Intake API
This API provides endpoints for managing Intakes.
API version: 1beta.3.5
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package intakebeta

View file

@ -0,0 +1,117 @@
/*
STACKIT Intake API
This API provides endpoints for managing Intakes.
API version: 1beta.3.5
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package intakebeta
import (
"encoding/json"
"fmt"
)
// PartitioningType The target table's partitioning. * `none` disables partitioning, the default. * `intake-time` configures daily partitioning based on the automatically created ingestion time column `__intake_ts`. * `manual` allows arbitrary Iceberg partitioning expression to be set via `partitionBy`.
type PartitioningType string
// List of partitioningType
const (
PARTITIONINGTYPE_NONE PartitioningType = "none"
PARTITIONINGTYPE_INTAKE_TIME PartitioningType = "intake-time"
PARTITIONINGTYPE_MANUAL PartitioningType = "manual"
)
// All allowed values of PartitioningType enum
var AllowedPartitioningTypeEnumValues = []PartitioningType{
"none",
"intake-time",
"manual",
}
func (v *PartitioningType) 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 := PartitioningType(value)
for _, existing := range AllowedPartitioningTypeEnumValues {
if existing == enumTypeValue {
*v = enumTypeValue
return nil
}
}
return fmt.Errorf("%+v is not a valid PartitioningType", value)
}
// NewPartitioningTypeFromValue returns a pointer to a valid PartitioningType
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewPartitioningTypeFromValue(v string) (*PartitioningType, error) {
ev := PartitioningType(v)
if ev.IsValid() {
return &ev, nil
} else {
return nil, fmt.Errorf("invalid value '%v' for PartitioningType: valid values are %v", v, AllowedPartitioningTypeEnumValues)
}
}
// IsValid return true if the value is valid for the enum, false otherwise
func (v PartitioningType) IsValid() bool {
for _, existing := range AllowedPartitioningTypeEnumValues {
if existing == v {
return true
}
}
return false
}
// Ptr returns reference to partitioningType value
func (v PartitioningType) Ptr() *PartitioningType {
return &v
}
type NullablePartitioningType struct {
value *PartitioningType
isSet bool
}
func (v NullablePartitioningType) Get() *PartitioningType {
return v.value
}
func (v *NullablePartitioningType) Set(val *PartitioningType) {
v.value = val
v.isSet = true
}
func (v NullablePartitioningType) IsSet() bool {
return v.isSet
}
func (v *NullablePartitioningType) Unset() {
v.value = nil
v.isSet = false
}
func NewNullablePartitioningType(val *PartitioningType) *NullablePartitioningType {
return &NullablePartitioningType{value: val, isSet: true}
}
func (v NullablePartitioningType) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullablePartitioningType) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,11 @@
/*
STACKIT Intake API
This API provides endpoints for managing Intakes.
API version: 1beta.3.5
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package intakebeta

View file

@ -0,0 +1,117 @@
/*
STACKIT Intake API
This API provides endpoints for managing Intakes.
API version: 1beta.3.5
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package intakebeta
import (
"encoding/json"
"fmt"
)
// PartitioningUpdateType The target table's partitioning. * `none` disables partitioning. * `intake-time` configures daily partitioning based on the automatically created ingestion time column `__intake_ts`. * `manual` allows arbitrary Iceberg partitioning expression to be set via `partitionBy`.
type PartitioningUpdateType string
// List of partitioningUpdateType
const (
PARTITIONINGUPDATETYPE_NONE PartitioningUpdateType = "none"
PARTITIONINGUPDATETYPE_INTAKE_TIME PartitioningUpdateType = "intake-time"
PARTITIONINGUPDATETYPE_MANUAL PartitioningUpdateType = "manual"
)
// All allowed values of PartitioningUpdateType enum
var AllowedPartitioningUpdateTypeEnumValues = []PartitioningUpdateType{
"none",
"intake-time",
"manual",
}
func (v *PartitioningUpdateType) 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 := PartitioningUpdateType(value)
for _, existing := range AllowedPartitioningUpdateTypeEnumValues {
if existing == enumTypeValue {
*v = enumTypeValue
return nil
}
}
return fmt.Errorf("%+v is not a valid PartitioningUpdateType", value)
}
// NewPartitioningUpdateTypeFromValue returns a pointer to a valid PartitioningUpdateType
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewPartitioningUpdateTypeFromValue(v string) (*PartitioningUpdateType, error) {
ev := PartitioningUpdateType(v)
if ev.IsValid() {
return &ev, nil
} else {
return nil, fmt.Errorf("invalid value '%v' for PartitioningUpdateType: valid values are %v", v, AllowedPartitioningUpdateTypeEnumValues)
}
}
// IsValid return true if the value is valid for the enum, false otherwise
func (v PartitioningUpdateType) IsValid() bool {
for _, existing := range AllowedPartitioningUpdateTypeEnumValues {
if existing == v {
return true
}
}
return false
}
// Ptr returns reference to partitioningUpdateType value
func (v PartitioningUpdateType) Ptr() *PartitioningUpdateType {
return &v
}
type NullablePartitioningUpdateType struct {
value *PartitioningUpdateType
isSet bool
}
func (v NullablePartitioningUpdateType) Get() *PartitioningUpdateType {
return v.value
}
func (v *NullablePartitioningUpdateType) Set(val *PartitioningUpdateType) {
v.value = val
v.isSet = true
}
func (v NullablePartitioningUpdateType) IsSet() bool {
return v.isSet
}
func (v *NullablePartitioningUpdateType) Unset() {
v.value = nil
v.isSet = false
}
func NewNullablePartitioningUpdateType(val *PartitioningUpdateType) *NullablePartitioningUpdateType {
return &NullablePartitioningUpdateType{value: val, isSet: true}
}
func (v NullablePartitioningUpdateType) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullablePartitioningUpdateType) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,11 @@
/*
STACKIT Intake API
This API provides endpoints for managing Intakes.
API version: 1beta.3.5
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package intakebeta

View file

@ -0,0 +1,321 @@
/*
STACKIT Intake API
This API provides endpoints for managing Intakes.
API version: 1beta.3.5
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package intakebeta
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)
}

View file

@ -0,0 +1,11 @@
/*
STACKIT Intake API
This API provides endpoints for managing Intakes.
API version: 1beta.3.5
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package intakebeta

View file

@ -0,0 +1,323 @@
/*
STACKIT Intake API
This API provides endpoints for managing Intakes.
API version: 1beta.3.5
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package intakebeta
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).
MaxMessageSizeKiB UpdateIntakeRunnerPayloadGetMaxMessageSizeKiBAttributeType `json:"maxMessageSizeKiB,omitempty"`
// The maximum number of messages per hour.
MaxMessagesPerHour UpdateIntakeRunnerPayloadGetMaxMessagesPerHourAttributeType `json:"maxMessagesPerHour,omitempty"`
}
// 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() *UpdateIntakeRunnerPayload {
this := UpdateIntakeRunnerPayload{}
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 if set, zero value otherwise.
func (o *UpdateIntakeRunnerPayload) GetMaxMessageSizeKiB() (res UpdateIntakeRunnerPayloadGetMaxMessageSizeKiBRetType) {
res, _ = o.GetMaxMessageSizeKiBOk()
return
}
// GetMaxMessageSizeKiBOk returns a tuple with the MaxMessageSizeKiB field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateIntakeRunnerPayload) GetMaxMessageSizeKiBOk() (ret UpdateIntakeRunnerPayloadGetMaxMessageSizeKiBRetType, ok bool) {
return getUpdateIntakeRunnerPayloadGetMaxMessageSizeKiBAttributeTypeOk(o.MaxMessageSizeKiB)
}
// HasMaxMessageSizeKiB returns a boolean if a field has been set.
func (o *UpdateIntakeRunnerPayload) HasMaxMessageSizeKiB() bool {
_, ok := o.GetMaxMessageSizeKiBOk()
return ok
}
// SetMaxMessageSizeKiB gets a reference to the given int64 and assigns it to the MaxMessageSizeKiB field.
func (o *UpdateIntakeRunnerPayload) SetMaxMessageSizeKiB(v UpdateIntakeRunnerPayloadGetMaxMessageSizeKiBRetType) {
setUpdateIntakeRunnerPayloadGetMaxMessageSizeKiBAttributeType(&o.MaxMessageSizeKiB, v)
}
// GetMaxMessagesPerHour returns the MaxMessagesPerHour field value if set, zero value otherwise.
func (o *UpdateIntakeRunnerPayload) GetMaxMessagesPerHour() (res UpdateIntakeRunnerPayloadGetMaxMessagesPerHourRetType) {
res, _ = o.GetMaxMessagesPerHourOk()
return
}
// GetMaxMessagesPerHourOk returns a tuple with the MaxMessagesPerHour field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateIntakeRunnerPayload) GetMaxMessagesPerHourOk() (ret UpdateIntakeRunnerPayloadGetMaxMessagesPerHourRetType, ok bool) {
return getUpdateIntakeRunnerPayloadGetMaxMessagesPerHourAttributeTypeOk(o.MaxMessagesPerHour)
}
// HasMaxMessagesPerHour returns a boolean if a field has been set.
func (o *UpdateIntakeRunnerPayload) HasMaxMessagesPerHour() bool {
_, ok := o.GetMaxMessagesPerHourOk()
return ok
}
// SetMaxMessagesPerHour gets a reference to the given int64 and assigns it to the MaxMessagesPerHour field.
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)
}

View file

@ -0,0 +1,11 @@
/*
STACKIT Intake API
This API provides endpoints for managing Intakes.
API version: 1beta.3.5
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package intakebeta

View file

@ -0,0 +1,325 @@
/*
STACKIT Intake API
This API provides endpoints for managing Intakes.
API version: 1beta.3.5
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package intakebeta
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)
}

View file

@ -0,0 +1,11 @@
/*
STACKIT Intake API
This API provides endpoints for managing Intakes.
API version: 1beta.3.5
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package intakebeta

View file

@ -0,0 +1,115 @@
/*
STACKIT Intake API
This API provides endpoints for managing Intakes.
API version: 1beta.3.5
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package intakebeta
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)
}

View file

@ -0,0 +1,11 @@
/*
STACKIT Intake API
This API provides endpoints for managing Intakes.
API version: 1beta.3.5
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package intakebeta

385
pkg/intakebeta/utils.go Normal file
View file

@ -0,0 +1,385 @@
/*
STACKIT Intake API
This API provides endpoints for managing Intakes.
API version: 1beta.3.5
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package intakebeta
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)
}