feat: generating code
This commit is contained in:
parent
c329d58970
commit
51663cd8d0
1221 changed files with 271709 additions and 2444 deletions
1
pkg/kmsbeta/.openapi-generator/VERSION
Normal file
1
pkg/kmsbeta/.openapi-generator/VERSION
Normal file
|
|
@ -0,0 +1 @@
|
|||
6.6.0
|
||||
5390
pkg/kmsbeta/api_default.go
Normal file
5390
pkg/kmsbeta/api_default.go
Normal file
File diff suppressed because it is too large
Load diff
1509
pkg/kmsbeta/api_default_test.go
Normal file
1509
pkg/kmsbeta/api_default_test.go
Normal file
File diff suppressed because it is too large
Load diff
631
pkg/kmsbeta/client.go
Normal file
631
pkg/kmsbeta/client.go
Normal file
|
|
@ -0,0 +1,631 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
|
||||
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 Key Management Service API API v1beta.0.0
|
||||
// In most cases there should be only one, shared, APIClient.
|
||||
type APIClient struct {
|
||||
cfg *config.Configuration
|
||||
common service // Reuse a single struct instead of allocating one for each service on the heap.
|
||||
defaultApi *DefaultApiService
|
||||
}
|
||||
|
||||
type service struct {
|
||||
client DefaultApi
|
||||
}
|
||||
|
||||
// NewAPIClient creates a new API client.
|
||||
// Optionally receives configuration options
|
||||
func NewAPIClient(opts ...config.ConfigurationOption) (*APIClient, error) {
|
||||
cfg := NewConfiguration()
|
||||
|
||||
for _, option := range opts {
|
||||
err := option(cfg)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("configuring the client: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
err := config.ConfigureRegion(cfg)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("configuring region: %w", err)
|
||||
}
|
||||
|
||||
if cfg.HTTPClient == nil {
|
||||
cfg.HTTPClient = &http.Client{}
|
||||
}
|
||||
|
||||
authRoundTripper, err := auth.SetupAuth(cfg)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("setting up authentication: %w", err)
|
||||
}
|
||||
|
||||
roundTripper := authRoundTripper
|
||||
if cfg.Middleware != nil {
|
||||
roundTripper = config.ChainMiddleware(roundTripper, cfg.Middleware...)
|
||||
}
|
||||
|
||||
cfg.HTTPClient.Transport = roundTripper
|
||||
|
||||
c := &APIClient{}
|
||||
c.cfg = cfg
|
||||
c.common.client = c
|
||||
c.defaultApi = (*DefaultApiService)(&c.common)
|
||||
|
||||
return c, nil
|
||||
}
|
||||
|
||||
func atoi(in string) (int, error) {
|
||||
return strconv.Atoi(in)
|
||||
}
|
||||
|
||||
// selectHeaderContentType select a content type from the available list.
|
||||
func selectHeaderContentType(contentTypes []string) string {
|
||||
if len(contentTypes) == 0 {
|
||||
return ""
|
||||
}
|
||||
if contains(contentTypes, "application/json") {
|
||||
return "application/json"
|
||||
}
|
||||
return contentTypes[0] // use the first content type specified in 'consumes'
|
||||
}
|
||||
|
||||
// selectHeaderAccept join all accept types and return
|
||||
func selectHeaderAccept(accepts []string) string {
|
||||
if len(accepts) == 0 {
|
||||
return ""
|
||||
}
|
||||
|
||||
if contains(accepts, "application/json") {
|
||||
return "application/json"
|
||||
}
|
||||
|
||||
return strings.Join(accepts, ",")
|
||||
}
|
||||
|
||||
// contains is a case insensitive match, finding needle in a haystack
|
||||
func contains(haystack []string, needle string) bool {
|
||||
for _, a := range haystack {
|
||||
if strings.EqualFold(a, needle) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// Verify optional parameters are of the correct type.
|
||||
func typeCheckParameter(obj interface{}, expected string, name string) error {
|
||||
// Make sure there is an object.
|
||||
if obj == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Check the type is as expected.
|
||||
if reflect.TypeOf(obj).String() != expected {
|
||||
return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String())
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func ParameterValueToString(obj interface{}, key string) string {
|
||||
if reflect.TypeOf(obj).Kind() != reflect.Ptr {
|
||||
return fmt.Sprintf("%v", obj)
|
||||
}
|
||||
var param, ok = obj.(MappedNullable)
|
||||
if !ok {
|
||||
return ""
|
||||
}
|
||||
dataMap, err := param.ToMap()
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
return fmt.Sprintf("%v", dataMap[key])
|
||||
}
|
||||
|
||||
// parameterAddToHeaderOrQuery adds the provided object to the request header or url query
|
||||
// supporting deep object syntax
|
||||
func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) {
|
||||
var v = reflect.ValueOf(obj)
|
||||
var value = ""
|
||||
if v == reflect.ValueOf(nil) {
|
||||
value = "null"
|
||||
} else {
|
||||
switch v.Kind() {
|
||||
case reflect.Invalid:
|
||||
value = "invalid"
|
||||
|
||||
case reflect.Struct:
|
||||
if t, ok := obj.(MappedNullable); ok {
|
||||
dataMap, err := t.ToMap()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType)
|
||||
return
|
||||
}
|
||||
if t, ok := obj.(time.Time); ok {
|
||||
parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType)
|
||||
return
|
||||
}
|
||||
value = v.Type().String() + " value"
|
||||
case reflect.Slice:
|
||||
var indValue = reflect.ValueOf(obj)
|
||||
if indValue == reflect.ValueOf(nil) {
|
||||
return
|
||||
}
|
||||
var lenIndValue = indValue.Len()
|
||||
for i := 0; i < lenIndValue; i++ {
|
||||
var arrayValue = indValue.Index(i)
|
||||
parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, arrayValue.Interface(), collectionType)
|
||||
}
|
||||
return
|
||||
|
||||
case reflect.Map:
|
||||
var indValue = reflect.ValueOf(obj)
|
||||
if indValue == reflect.ValueOf(nil) {
|
||||
return
|
||||
}
|
||||
iter := indValue.MapRange()
|
||||
for iter.Next() {
|
||||
k, v := iter.Key(), iter.Value()
|
||||
parameterAddToHeaderOrQuery(headerOrQueryParams, fmt.Sprintf("%s[%s]", keyPrefix, k.String()), v.Interface(), collectionType)
|
||||
}
|
||||
return
|
||||
|
||||
case reflect.Interface:
|
||||
fallthrough
|
||||
case reflect.Ptr:
|
||||
parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, v.Elem().Interface(), collectionType)
|
||||
return
|
||||
|
||||
case reflect.Int, reflect.Int8, reflect.Int16,
|
||||
reflect.Int32, reflect.Int64:
|
||||
value = strconv.FormatInt(v.Int(), 10)
|
||||
case reflect.Uint, reflect.Uint8, reflect.Uint16,
|
||||
reflect.Uint32, reflect.Uint64, reflect.Uintptr:
|
||||
value = strconv.FormatUint(v.Uint(), 10)
|
||||
case reflect.Float32, reflect.Float64:
|
||||
value = strconv.FormatFloat(v.Float(), 'g', -1, 32)
|
||||
case reflect.Bool:
|
||||
value = strconv.FormatBool(v.Bool())
|
||||
case reflect.String:
|
||||
value = v.String()
|
||||
default:
|
||||
value = v.Type().String() + " value"
|
||||
}
|
||||
}
|
||||
|
||||
switch valuesMap := headerOrQueryParams.(type) {
|
||||
case url.Values:
|
||||
if collectionType == "csv" && valuesMap.Get(keyPrefix) != "" {
|
||||
valuesMap.Set(keyPrefix, valuesMap.Get(keyPrefix)+","+value)
|
||||
} else {
|
||||
valuesMap.Add(keyPrefix, value)
|
||||
}
|
||||
break
|
||||
case map[string]string:
|
||||
valuesMap[keyPrefix] = value
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
// helper for converting interface{} parameters to json strings
|
||||
func parameterToJson(obj interface{}) (string, error) {
|
||||
jsonBuf, err := json.Marshal(obj)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return string(jsonBuf), err
|
||||
}
|
||||
|
||||
// callAPI do the request.
|
||||
func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) {
|
||||
if c.cfg.Debug {
|
||||
dump, err := httputil.DumpRequestOut(request, true)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
log.Printf("\n%s\n", string(dump))
|
||||
}
|
||||
|
||||
resp, err := c.cfg.HTTPClient.Do(request)
|
||||
if err != nil {
|
||||
return resp, err
|
||||
}
|
||||
|
||||
if c.cfg.Debug {
|
||||
dump, err := httputil.DumpResponse(resp, true)
|
||||
if err != nil {
|
||||
return resp, err
|
||||
}
|
||||
log.Printf("\n%s\n", string(dump))
|
||||
}
|
||||
return resp, err
|
||||
}
|
||||
|
||||
// Allow modification of underlying config for alternate implementations and testing
|
||||
// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior
|
||||
func (c *APIClient) GetConfig() *config.Configuration {
|
||||
return c.cfg
|
||||
}
|
||||
|
||||
type formFile struct {
|
||||
fileBytes []byte
|
||||
fileName string
|
||||
formFileName string
|
||||
}
|
||||
|
||||
// prepareRequest build the request
|
||||
func (c *APIClient) prepareRequest(
|
||||
ctx context.Context,
|
||||
path string, method string,
|
||||
postBody interface{},
|
||||
headerParams map[string]string,
|
||||
queryParams url.Values,
|
||||
formParams url.Values,
|
||||
formFiles []formFile) (localVarRequest *http.Request, err error) {
|
||||
|
||||
var body *bytes.Buffer
|
||||
|
||||
// Detect postBody type and post.
|
||||
if !IsNil(postBody) {
|
||||
contentType := headerParams["Content-Type"]
|
||||
if contentType == "" {
|
||||
contentType = detectContentType(postBody)
|
||||
headerParams["Content-Type"] = contentType
|
||||
}
|
||||
|
||||
body, err = setBody(postBody, contentType)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
// add form parameters and file if available.
|
||||
if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(formFiles) > 0) {
|
||||
if body != nil {
|
||||
return nil, fmt.Errorf("cannot specify postBody and multipart form at the same time.")
|
||||
}
|
||||
body = &bytes.Buffer{}
|
||||
w := multipart.NewWriter(body)
|
||||
|
||||
for k, v := range formParams {
|
||||
for _, iv := range v {
|
||||
if strings.HasPrefix(k, "@") { // file
|
||||
err = addFile(w, k[1:], iv)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
} else { // form value
|
||||
w.WriteField(k, iv)
|
||||
}
|
||||
}
|
||||
}
|
||||
for _, formFile := range formFiles {
|
||||
if len(formFile.fileBytes) > 0 && formFile.fileName != "" {
|
||||
w.Boundary()
|
||||
part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
_, err = part.Write(formFile.fileBytes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set the Boundary in the Content-Type
|
||||
headerParams["Content-Type"] = w.FormDataContentType()
|
||||
|
||||
// Set Content-Length
|
||||
headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len())
|
||||
w.Close()
|
||||
}
|
||||
|
||||
if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 {
|
||||
if body != nil {
|
||||
return nil, fmt.Errorf("cannot specify postBody and x-www-form-urlencoded form at the same time.")
|
||||
}
|
||||
body = &bytes.Buffer{}
|
||||
body.WriteString(formParams.Encode())
|
||||
// Set Content-Length
|
||||
headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len())
|
||||
}
|
||||
|
||||
// Setup path and query parameters
|
||||
url, err := url.Parse(path)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Override request host, if applicable
|
||||
if c.cfg.Host != "" {
|
||||
url.Host = c.cfg.Host
|
||||
}
|
||||
|
||||
// Override request scheme, if applicable
|
||||
if c.cfg.Scheme != "" {
|
||||
url.Scheme = c.cfg.Scheme
|
||||
}
|
||||
|
||||
// Adding Query Param
|
||||
query := url.Query()
|
||||
for k, v := range queryParams {
|
||||
for _, iv := range v {
|
||||
query.Add(k, iv)
|
||||
}
|
||||
}
|
||||
|
||||
// Encode the parameters.
|
||||
url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string {
|
||||
pieces := strings.Split(s, "=")
|
||||
pieces[0] = queryDescape.Replace(pieces[0])
|
||||
return strings.Join(pieces, "=")
|
||||
})
|
||||
|
||||
// Generate a new request
|
||||
if body != nil {
|
||||
localVarRequest, err = http.NewRequest(method, url.String(), body)
|
||||
} else {
|
||||
localVarRequest, err = http.NewRequest(method, url.String(), nil)
|
||||
}
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// add header parameters, if any
|
||||
if len(headerParams) > 0 {
|
||||
headers := http.Header{}
|
||||
for h, v := range headerParams {
|
||||
headers[h] = []string{v}
|
||||
}
|
||||
localVarRequest.Header = headers
|
||||
}
|
||||
|
||||
// Add the user agent to the request.
|
||||
localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent)
|
||||
|
||||
if ctx != nil {
|
||||
// add context to the request
|
||||
localVarRequest = localVarRequest.WithContext(ctx)
|
||||
|
||||
// Walk through any authentication.
|
||||
|
||||
}
|
||||
|
||||
for header, value := range c.cfg.DefaultHeader {
|
||||
localVarRequest.Header.Add(header, value)
|
||||
}
|
||||
return localVarRequest, nil
|
||||
}
|
||||
|
||||
func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) {
|
||||
if len(b) == 0 {
|
||||
return nil
|
||||
}
|
||||
if s, ok := v.(*string); ok {
|
||||
*s = string(b)
|
||||
return nil
|
||||
}
|
||||
if f, ok := v.(*os.File); ok {
|
||||
f, err = os.CreateTemp("", "HttpClientFile")
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
_, err = f.Write(b)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
_, err = f.Seek(0, io.SeekStart)
|
||||
return
|
||||
}
|
||||
if f, ok := v.(**os.File); ok {
|
||||
*f, err = os.CreateTemp("", "HttpClientFile")
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
_, err = (*f).Write(b)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
_, err = (*f).Seek(0, io.SeekStart)
|
||||
return
|
||||
}
|
||||
if xmlCheck.MatchString(contentType) {
|
||||
if err = xml.Unmarshal(b, v); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
if jsonCheck.MatchString(contentType) {
|
||||
if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas
|
||||
if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined
|
||||
if err = unmarshalObj.UnmarshalJSON(b); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
return fmt.Errorf("unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined")
|
||||
}
|
||||
} else if err = json.Unmarshal(b, v); err != nil { // simple model
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("undefined response type")
|
||||
}
|
||||
|
||||
// Add a file to the multipart request
|
||||
func addFile(w *multipart.Writer, fieldName, path string) error {
|
||||
file, err := os.Open(filepath.Clean(path))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = file.Close()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
part, err := w.CreateFormFile(fieldName, filepath.Base(path))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
_, err = io.Copy(part, file)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// A wrapper for strict JSON decoding
|
||||
func newStrictDecoder(data []byte) *json.Decoder {
|
||||
dec := json.NewDecoder(bytes.NewBuffer(data))
|
||||
dec.DisallowUnknownFields()
|
||||
return dec
|
||||
}
|
||||
|
||||
// Set request body from an interface{}
|
||||
func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) {
|
||||
if bodyBuf == nil {
|
||||
bodyBuf = &bytes.Buffer{}
|
||||
}
|
||||
|
||||
if reader, ok := body.(io.Reader); ok {
|
||||
_, err = bodyBuf.ReadFrom(reader)
|
||||
} else if fp, ok := body.(*os.File); ok {
|
||||
_, err = bodyBuf.ReadFrom(fp)
|
||||
} else if b, ok := body.([]byte); ok {
|
||||
_, err = bodyBuf.Write(b)
|
||||
} else if s, ok := body.(string); ok {
|
||||
_, err = bodyBuf.WriteString(s)
|
||||
} else if s, ok := body.(*string); ok {
|
||||
_, err = bodyBuf.WriteString(*s)
|
||||
} else if jsonCheck.MatchString(contentType) {
|
||||
err = json.NewEncoder(bodyBuf).Encode(body)
|
||||
} else if xmlCheck.MatchString(contentType) {
|
||||
err = xml.NewEncoder(bodyBuf).Encode(body)
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if bodyBuf.Len() == 0 {
|
||||
err = fmt.Errorf("invalid body type %s", contentType)
|
||||
return nil, err
|
||||
}
|
||||
return bodyBuf, nil
|
||||
}
|
||||
|
||||
// detectContentType method is used to figure out `Request.Body` content type for request header
|
||||
func detectContentType(body interface{}) string {
|
||||
contentType := "text/plain; charset=utf-8"
|
||||
kind := reflect.TypeOf(body).Kind()
|
||||
|
||||
switch kind {
|
||||
case reflect.Struct, reflect.Map, reflect.Ptr:
|
||||
contentType = "application/json; charset=utf-8"
|
||||
case reflect.String:
|
||||
contentType = "text/plain; charset=utf-8"
|
||||
default:
|
||||
if b, ok := body.([]byte); ok {
|
||||
contentType = http.DetectContentType(b)
|
||||
} else if kind == reflect.Slice {
|
||||
contentType = "application/json; charset=utf-8"
|
||||
}
|
||||
}
|
||||
|
||||
return contentType
|
||||
}
|
||||
|
||||
// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go
|
||||
type cacheControl map[string]string
|
||||
|
||||
func parseCacheControl(headers http.Header) cacheControl {
|
||||
cc := cacheControl{}
|
||||
ccHeader := headers.Get("Cache-Control")
|
||||
for _, part := range strings.Split(ccHeader, ",") {
|
||||
part = strings.Trim(part, " ")
|
||||
if part == "" {
|
||||
continue
|
||||
}
|
||||
if strings.ContainsRune(part, '=') {
|
||||
keyval := strings.Split(part, "=")
|
||||
cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",")
|
||||
} else {
|
||||
cc[part] = ""
|
||||
}
|
||||
}
|
||||
return cc
|
||||
}
|
||||
|
||||
// CacheExpires helper function to determine remaining time before repeating a request.
|
||||
func CacheExpires(r *http.Response) time.Time {
|
||||
// Figure out when the cache expires.
|
||||
var expires time.Time
|
||||
now, err := time.Parse(time.RFC1123, r.Header.Get("date"))
|
||||
if err != nil {
|
||||
return time.Now()
|
||||
}
|
||||
respCacheControl := parseCacheControl(r.Header)
|
||||
|
||||
if maxAge, ok := respCacheControl["max-age"]; ok {
|
||||
lifetime, err := time.ParseDuration(maxAge + "s")
|
||||
if err != nil {
|
||||
expires = now
|
||||
} else {
|
||||
expires = now.Add(lifetime)
|
||||
}
|
||||
} else {
|
||||
expiresHeader := r.Header.Get("Expires")
|
||||
if expiresHeader != "" {
|
||||
expires, err = time.Parse(time.RFC1123, expiresHeader)
|
||||
if err != nil {
|
||||
expires = now
|
||||
}
|
||||
}
|
||||
}
|
||||
return expires
|
||||
}
|
||||
|
||||
func strlen(s string) int {
|
||||
return utf8.RuneCountInString(s)
|
||||
}
|
||||
41
pkg/kmsbeta/configuration.go
Normal file
41
pkg/kmsbeta/configuration.go
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
|
||||
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/kmsbeta",
|
||||
Debug: false,
|
||||
Servers: config.ServerConfigurations{
|
||||
{
|
||||
URL: "https://kms.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
|
||||
}
|
||||
115
pkg/kmsbeta/model_access_scope.go
Normal file
115
pkg/kmsbeta/model_access_scope.go
Normal file
|
|
@ -0,0 +1,115 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// AccessScope The access scope of the key.
|
||||
type AccessScope string
|
||||
|
||||
// List of access_scope
|
||||
const (
|
||||
ACCESSSCOPE_PUBLIC AccessScope = "PUBLIC"
|
||||
ACCESSSCOPE_SNA AccessScope = "SNA"
|
||||
)
|
||||
|
||||
// All allowed values of AccessScope enum
|
||||
var AllowedAccessScopeEnumValues = []AccessScope{
|
||||
"PUBLIC",
|
||||
"SNA",
|
||||
}
|
||||
|
||||
func (v *AccessScope) 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 := AccessScope(value)
|
||||
for _, existing := range AllowedAccessScopeEnumValues {
|
||||
if existing == enumTypeValue {
|
||||
*v = enumTypeValue
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
return fmt.Errorf("%+v is not a valid AccessScope", value)
|
||||
}
|
||||
|
||||
// NewAccessScopeFromValue returns a pointer to a valid AccessScope
|
||||
// for the value passed as argument, or an error if the value passed is not allowed by the enum
|
||||
func NewAccessScopeFromValue(v string) (*AccessScope, error) {
|
||||
ev := AccessScope(v)
|
||||
if ev.IsValid() {
|
||||
return &ev, nil
|
||||
} else {
|
||||
return nil, fmt.Errorf("invalid value '%v' for AccessScope: valid values are %v", v, AllowedAccessScopeEnumValues)
|
||||
}
|
||||
}
|
||||
|
||||
// IsValid return true if the value is valid for the enum, false otherwise
|
||||
func (v AccessScope) IsValid() bool {
|
||||
for _, existing := range AllowedAccessScopeEnumValues {
|
||||
if existing == v {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// Ptr returns reference to access_scope value
|
||||
func (v AccessScope) Ptr() *AccessScope {
|
||||
return &v
|
||||
}
|
||||
|
||||
type NullableAccessScope struct {
|
||||
value *AccessScope
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableAccessScope) Get() *AccessScope {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableAccessScope) Set(val *AccessScope) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableAccessScope) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableAccessScope) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableAccessScope(val *AccessScope) *NullableAccessScope {
|
||||
return &NullableAccessScope{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableAccessScope) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableAccessScope) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
11
pkg/kmsbeta/model_access_scope_test.go
Normal file
11
pkg/kmsbeta/model_access_scope_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
133
pkg/kmsbeta/model_algorithm.go
Normal file
133
pkg/kmsbeta/model_algorithm.go
Normal file
|
|
@ -0,0 +1,133 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// Algorithm The algorithm the key material uses.
|
||||
type Algorithm string
|
||||
|
||||
// List of algorithm
|
||||
const (
|
||||
ALGORITHM_AES_256_GCM Algorithm = "aes_256_gcm"
|
||||
ALGORITHM_RSA_2048_OAEP_SHA256 Algorithm = "rsa_2048_oaep_sha256"
|
||||
ALGORITHM_RSA_3072_OAEP_SHA256 Algorithm = "rsa_3072_oaep_sha256"
|
||||
ALGORITHM_RSA_4096_OAEP_SHA256 Algorithm = "rsa_4096_oaep_sha256"
|
||||
ALGORITHM_RSA_4096_OAEP_SHA512 Algorithm = "rsa_4096_oaep_sha512"
|
||||
ALGORITHM_HMAC_SHA256 Algorithm = "hmac_sha256"
|
||||
ALGORITHM_HMAC_SHA384 Algorithm = "hmac_sha384"
|
||||
ALGORITHM_HMAC_SHA512 Algorithm = "hmac_sha512"
|
||||
ALGORITHM_ECDSA_P256_SHA256 Algorithm = "ecdsa_p256_sha256"
|
||||
ALGORITHM_ECDSA_P384_SHA384 Algorithm = "ecdsa_p384_sha384"
|
||||
ALGORITHM_ECDSA_P521_SHA512 Algorithm = "ecdsa_p521_sha512"
|
||||
)
|
||||
|
||||
// All allowed values of Algorithm enum
|
||||
var AllowedAlgorithmEnumValues = []Algorithm{
|
||||
"aes_256_gcm",
|
||||
"rsa_2048_oaep_sha256",
|
||||
"rsa_3072_oaep_sha256",
|
||||
"rsa_4096_oaep_sha256",
|
||||
"rsa_4096_oaep_sha512",
|
||||
"hmac_sha256",
|
||||
"hmac_sha384",
|
||||
"hmac_sha512",
|
||||
"ecdsa_p256_sha256",
|
||||
"ecdsa_p384_sha384",
|
||||
"ecdsa_p521_sha512",
|
||||
}
|
||||
|
||||
func (v *Algorithm) 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 := Algorithm(value)
|
||||
for _, existing := range AllowedAlgorithmEnumValues {
|
||||
if existing == enumTypeValue {
|
||||
*v = enumTypeValue
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
return fmt.Errorf("%+v is not a valid Algorithm", value)
|
||||
}
|
||||
|
||||
// NewAlgorithmFromValue returns a pointer to a valid Algorithm
|
||||
// for the value passed as argument, or an error if the value passed is not allowed by the enum
|
||||
func NewAlgorithmFromValue(v string) (*Algorithm, error) {
|
||||
ev := Algorithm(v)
|
||||
if ev.IsValid() {
|
||||
return &ev, nil
|
||||
} else {
|
||||
return nil, fmt.Errorf("invalid value '%v' for Algorithm: valid values are %v", v, AllowedAlgorithmEnumValues)
|
||||
}
|
||||
}
|
||||
|
||||
// IsValid return true if the value is valid for the enum, false otherwise
|
||||
func (v Algorithm) IsValid() bool {
|
||||
for _, existing := range AllowedAlgorithmEnumValues {
|
||||
if existing == v {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// Ptr returns reference to algorithm value
|
||||
func (v Algorithm) Ptr() *Algorithm {
|
||||
return &v
|
||||
}
|
||||
|
||||
type NullableAlgorithm struct {
|
||||
value *Algorithm
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableAlgorithm) Get() *Algorithm {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableAlgorithm) Set(val *Algorithm) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableAlgorithm) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableAlgorithm) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableAlgorithm(val *Algorithm) *NullableAlgorithm {
|
||||
return &NullableAlgorithm{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableAlgorithm) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableAlgorithm) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
11
pkg/kmsbeta/model_algorithm_test.go
Normal file
11
pkg/kmsbeta/model_algorithm_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
113
pkg/kmsbeta/model_backend.go
Normal file
113
pkg/kmsbeta/model_backend.go
Normal file
|
|
@ -0,0 +1,113 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// Backend The backend that is responsible for maintaining this key. Deprecated - use `protection`.
|
||||
type Backend string
|
||||
|
||||
// List of backend
|
||||
const (
|
||||
BACKEND_SOFTWARE Backend = "software"
|
||||
)
|
||||
|
||||
// All allowed values of Backend enum
|
||||
var AllowedBackendEnumValues = []Backend{
|
||||
"software",
|
||||
}
|
||||
|
||||
func (v *Backend) 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 := Backend(value)
|
||||
for _, existing := range AllowedBackendEnumValues {
|
||||
if existing == enumTypeValue {
|
||||
*v = enumTypeValue
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
return fmt.Errorf("%+v is not a valid Backend", value)
|
||||
}
|
||||
|
||||
// NewBackendFromValue returns a pointer to a valid Backend
|
||||
// for the value passed as argument, or an error if the value passed is not allowed by the enum
|
||||
func NewBackendFromValue(v string) (*Backend, error) {
|
||||
ev := Backend(v)
|
||||
if ev.IsValid() {
|
||||
return &ev, nil
|
||||
} else {
|
||||
return nil, fmt.Errorf("invalid value '%v' for Backend: valid values are %v", v, AllowedBackendEnumValues)
|
||||
}
|
||||
}
|
||||
|
||||
// IsValid return true if the value is valid for the enum, false otherwise
|
||||
func (v Backend) IsValid() bool {
|
||||
for _, existing := range AllowedBackendEnumValues {
|
||||
if existing == v {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// Ptr returns reference to backend value
|
||||
func (v Backend) Ptr() *Backend {
|
||||
return &v
|
||||
}
|
||||
|
||||
type NullableBackend struct {
|
||||
value *Backend
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableBackend) Get() *Backend {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableBackend) Set(val *Backend) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableBackend) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableBackend) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableBackend(val *Backend) *NullableBackend {
|
||||
return &NullableBackend{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableBackend) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableBackend) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
11
pkg/kmsbeta/model_backend_test.go
Normal file
11
pkg/kmsbeta/model_backend_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
455
pkg/kmsbeta/model_create_key_payload.go
Normal file
455
pkg/kmsbeta/model_create_key_payload.go
Normal file
|
|
@ -0,0 +1,455 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the CreateKeyPayload type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &CreateKeyPayload{}
|
||||
|
||||
/*
|
||||
types and functions for access_scope
|
||||
*/
|
||||
|
||||
// isEnumRef
|
||||
type CreateKeyPayloadGetAccessScopeAttributeType = *AccessScope
|
||||
type CreateKeyPayloadGetAccessScopeArgType = AccessScope
|
||||
type CreateKeyPayloadGetAccessScopeRetType = AccessScope
|
||||
|
||||
func getCreateKeyPayloadGetAccessScopeAttributeTypeOk(arg CreateKeyPayloadGetAccessScopeAttributeType) (ret CreateKeyPayloadGetAccessScopeRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setCreateKeyPayloadGetAccessScopeAttributeType(arg *CreateKeyPayloadGetAccessScopeAttributeType, val CreateKeyPayloadGetAccessScopeRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for algorithm
|
||||
*/
|
||||
|
||||
// isEnumRef
|
||||
type CreateKeyPayloadGetAlgorithmAttributeType = *Algorithm
|
||||
type CreateKeyPayloadGetAlgorithmArgType = Algorithm
|
||||
type CreateKeyPayloadGetAlgorithmRetType = Algorithm
|
||||
|
||||
func getCreateKeyPayloadGetAlgorithmAttributeTypeOk(arg CreateKeyPayloadGetAlgorithmAttributeType) (ret CreateKeyPayloadGetAlgorithmRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setCreateKeyPayloadGetAlgorithmAttributeType(arg *CreateKeyPayloadGetAlgorithmAttributeType, val CreateKeyPayloadGetAlgorithmRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for backend
|
||||
*/
|
||||
|
||||
// isEnumRef
|
||||
type CreateKeyPayloadGetBackendAttributeType = *Backend
|
||||
type CreateKeyPayloadGetBackendArgType = Backend
|
||||
type CreateKeyPayloadGetBackendRetType = Backend
|
||||
|
||||
func getCreateKeyPayloadGetBackendAttributeTypeOk(arg CreateKeyPayloadGetBackendAttributeType) (ret CreateKeyPayloadGetBackendRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setCreateKeyPayloadGetBackendAttributeType(arg *CreateKeyPayloadGetBackendAttributeType, val CreateKeyPayloadGetBackendRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for description
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type CreateKeyPayloadGetDescriptionAttributeType = *string
|
||||
|
||||
func getCreateKeyPayloadGetDescriptionAttributeTypeOk(arg CreateKeyPayloadGetDescriptionAttributeType) (ret CreateKeyPayloadGetDescriptionRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setCreateKeyPayloadGetDescriptionAttributeType(arg *CreateKeyPayloadGetDescriptionAttributeType, val CreateKeyPayloadGetDescriptionRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type CreateKeyPayloadGetDescriptionArgType = string
|
||||
type CreateKeyPayloadGetDescriptionRetType = string
|
||||
|
||||
/*
|
||||
types and functions for displayName
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type CreateKeyPayloadGetDisplayNameAttributeType = *string
|
||||
|
||||
func getCreateKeyPayloadGetDisplayNameAttributeTypeOk(arg CreateKeyPayloadGetDisplayNameAttributeType) (ret CreateKeyPayloadGetDisplayNameRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setCreateKeyPayloadGetDisplayNameAttributeType(arg *CreateKeyPayloadGetDisplayNameAttributeType, val CreateKeyPayloadGetDisplayNameRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type CreateKeyPayloadGetDisplayNameArgType = string
|
||||
type CreateKeyPayloadGetDisplayNameRetType = string
|
||||
|
||||
/*
|
||||
types and functions for importOnly
|
||||
*/
|
||||
|
||||
// isBoolean
|
||||
type CreateKeyPayloadgetImportOnlyAttributeType = *bool
|
||||
type CreateKeyPayloadgetImportOnlyArgType = bool
|
||||
type CreateKeyPayloadgetImportOnlyRetType = bool
|
||||
|
||||
func getCreateKeyPayloadgetImportOnlyAttributeTypeOk(arg CreateKeyPayloadgetImportOnlyAttributeType) (ret CreateKeyPayloadgetImportOnlyRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setCreateKeyPayloadgetImportOnlyAttributeType(arg *CreateKeyPayloadgetImportOnlyAttributeType, val CreateKeyPayloadgetImportOnlyRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for protection
|
||||
*/
|
||||
|
||||
// isEnumRef
|
||||
type CreateKeyPayloadGetProtectionAttributeType = *Protection
|
||||
type CreateKeyPayloadGetProtectionArgType = Protection
|
||||
type CreateKeyPayloadGetProtectionRetType = Protection
|
||||
|
||||
func getCreateKeyPayloadGetProtectionAttributeTypeOk(arg CreateKeyPayloadGetProtectionAttributeType) (ret CreateKeyPayloadGetProtectionRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setCreateKeyPayloadGetProtectionAttributeType(arg *CreateKeyPayloadGetProtectionAttributeType, val CreateKeyPayloadGetProtectionRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for purpose
|
||||
*/
|
||||
|
||||
// isEnumRef
|
||||
type CreateKeyPayloadGetPurposeAttributeType = *Purpose
|
||||
type CreateKeyPayloadGetPurposeArgType = Purpose
|
||||
type CreateKeyPayloadGetPurposeRetType = Purpose
|
||||
|
||||
func getCreateKeyPayloadGetPurposeAttributeTypeOk(arg CreateKeyPayloadGetPurposeAttributeType) (ret CreateKeyPayloadGetPurposeRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setCreateKeyPayloadGetPurposeAttributeType(arg *CreateKeyPayloadGetPurposeAttributeType, val CreateKeyPayloadGetPurposeRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
// CreateKeyPayload struct for CreateKeyPayload
|
||||
type CreateKeyPayload struct {
|
||||
AccessScope CreateKeyPayloadGetAccessScopeAttributeType `json:"access_scope,omitempty"`
|
||||
// REQUIRED
|
||||
Algorithm CreateKeyPayloadGetAlgorithmAttributeType `json:"algorithm" required:"true"`
|
||||
// Deprecated: Check the GitHub changelog for alternatives
|
||||
// REQUIRED
|
||||
Backend CreateKeyPayloadGetBackendAttributeType `json:"backend" required:"true"`
|
||||
// A user chosen description to distinguish multiple keys.
|
||||
Description CreateKeyPayloadGetDescriptionAttributeType `json:"description,omitempty"`
|
||||
// The display name to distinguish multiple keys. Valid characters: letters, digits, underscores and hyphens.
|
||||
// REQUIRED
|
||||
DisplayName CreateKeyPayloadGetDisplayNameAttributeType `json:"displayName" required:"true"`
|
||||
// States whether versions can be created or only imported.
|
||||
ImportOnly CreateKeyPayloadgetImportOnlyAttributeType `json:"importOnly,omitempty"`
|
||||
Protection CreateKeyPayloadGetProtectionAttributeType `json:"protection,omitempty"`
|
||||
// REQUIRED
|
||||
Purpose CreateKeyPayloadGetPurposeAttributeType `json:"purpose" required:"true"`
|
||||
}
|
||||
|
||||
type _CreateKeyPayload CreateKeyPayload
|
||||
|
||||
// NewCreateKeyPayload instantiates a new CreateKeyPayload 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 NewCreateKeyPayload(algorithm CreateKeyPayloadGetAlgorithmArgType, backend CreateKeyPayloadGetBackendArgType, displayName CreateKeyPayloadGetDisplayNameArgType, purpose CreateKeyPayloadGetPurposeArgType) *CreateKeyPayload {
|
||||
this := CreateKeyPayload{}
|
||||
setCreateKeyPayloadGetAlgorithmAttributeType(&this.Algorithm, algorithm)
|
||||
setCreateKeyPayloadGetBackendAttributeType(&this.Backend, backend)
|
||||
setCreateKeyPayloadGetDisplayNameAttributeType(&this.DisplayName, displayName)
|
||||
setCreateKeyPayloadGetPurposeAttributeType(&this.Purpose, purpose)
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewCreateKeyPayloadWithDefaults instantiates a new CreateKeyPayload 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 NewCreateKeyPayloadWithDefaults() *CreateKeyPayload {
|
||||
this := CreateKeyPayload{}
|
||||
var accessScope AccessScope = ACCESSSCOPE_PUBLIC
|
||||
this.AccessScope = &accessScope
|
||||
var importOnly bool = false
|
||||
this.ImportOnly = &importOnly
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetAccessScope returns the AccessScope field value if set, zero value otherwise.
|
||||
func (o *CreateKeyPayload) GetAccessScope() (res CreateKeyPayloadGetAccessScopeRetType) {
|
||||
res, _ = o.GetAccessScopeOk()
|
||||
return
|
||||
}
|
||||
|
||||
// GetAccessScopeOk returns a tuple with the AccessScope field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *CreateKeyPayload) GetAccessScopeOk() (ret CreateKeyPayloadGetAccessScopeRetType, ok bool) {
|
||||
return getCreateKeyPayloadGetAccessScopeAttributeTypeOk(o.AccessScope)
|
||||
}
|
||||
|
||||
// HasAccessScope returns a boolean if a field has been set.
|
||||
func (o *CreateKeyPayload) HasAccessScope() bool {
|
||||
_, ok := o.GetAccessScopeOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetAccessScope gets a reference to the given AccessScope and assigns it to the AccessScope field.
|
||||
func (o *CreateKeyPayload) SetAccessScope(v CreateKeyPayloadGetAccessScopeRetType) {
|
||||
setCreateKeyPayloadGetAccessScopeAttributeType(&o.AccessScope, v)
|
||||
}
|
||||
|
||||
// GetAlgorithm returns the Algorithm field value
|
||||
func (o *CreateKeyPayload) GetAlgorithm() (ret CreateKeyPayloadGetAlgorithmRetType) {
|
||||
ret, _ = o.GetAlgorithmOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetAlgorithmOk returns a tuple with the Algorithm field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *CreateKeyPayload) GetAlgorithmOk() (ret CreateKeyPayloadGetAlgorithmRetType, ok bool) {
|
||||
return getCreateKeyPayloadGetAlgorithmAttributeTypeOk(o.Algorithm)
|
||||
}
|
||||
|
||||
// SetAlgorithm sets field value
|
||||
func (o *CreateKeyPayload) SetAlgorithm(v CreateKeyPayloadGetAlgorithmRetType) {
|
||||
setCreateKeyPayloadGetAlgorithmAttributeType(&o.Algorithm, v)
|
||||
}
|
||||
|
||||
// GetBackend returns the Backend field value
|
||||
// Deprecated
|
||||
func (o *CreateKeyPayload) GetBackend() (ret CreateKeyPayloadGetBackendRetType) {
|
||||
ret, _ = o.GetBackendOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetBackendOk returns a tuple with the Backend field value
|
||||
// and a boolean to check if the value has been set.
|
||||
// Deprecated
|
||||
func (o *CreateKeyPayload) GetBackendOk() (ret CreateKeyPayloadGetBackendRetType, ok bool) {
|
||||
return getCreateKeyPayloadGetBackendAttributeTypeOk(o.Backend)
|
||||
}
|
||||
|
||||
// SetBackend sets field value
|
||||
// Deprecated
|
||||
func (o *CreateKeyPayload) SetBackend(v CreateKeyPayloadGetBackendRetType) {
|
||||
setCreateKeyPayloadGetBackendAttributeType(&o.Backend, v)
|
||||
}
|
||||
|
||||
// GetDescription returns the Description field value if set, zero value otherwise.
|
||||
func (o *CreateKeyPayload) GetDescription() (res CreateKeyPayloadGetDescriptionRetType) {
|
||||
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 *CreateKeyPayload) GetDescriptionOk() (ret CreateKeyPayloadGetDescriptionRetType, ok bool) {
|
||||
return getCreateKeyPayloadGetDescriptionAttributeTypeOk(o.Description)
|
||||
}
|
||||
|
||||
// HasDescription returns a boolean if a field has been set.
|
||||
func (o *CreateKeyPayload) HasDescription() bool {
|
||||
_, ok := o.GetDescriptionOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetDescription gets a reference to the given string and assigns it to the Description field.
|
||||
func (o *CreateKeyPayload) SetDescription(v CreateKeyPayloadGetDescriptionRetType) {
|
||||
setCreateKeyPayloadGetDescriptionAttributeType(&o.Description, v)
|
||||
}
|
||||
|
||||
// GetDisplayName returns the DisplayName field value
|
||||
func (o *CreateKeyPayload) GetDisplayName() (ret CreateKeyPayloadGetDisplayNameRetType) {
|
||||
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 *CreateKeyPayload) GetDisplayNameOk() (ret CreateKeyPayloadGetDisplayNameRetType, ok bool) {
|
||||
return getCreateKeyPayloadGetDisplayNameAttributeTypeOk(o.DisplayName)
|
||||
}
|
||||
|
||||
// SetDisplayName sets field value
|
||||
func (o *CreateKeyPayload) SetDisplayName(v CreateKeyPayloadGetDisplayNameRetType) {
|
||||
setCreateKeyPayloadGetDisplayNameAttributeType(&o.DisplayName, v)
|
||||
}
|
||||
|
||||
// GetImportOnly returns the ImportOnly field value if set, zero value otherwise.
|
||||
func (o *CreateKeyPayload) GetImportOnly() (res CreateKeyPayloadgetImportOnlyRetType) {
|
||||
res, _ = o.GetImportOnlyOk()
|
||||
return
|
||||
}
|
||||
|
||||
// GetImportOnlyOk returns a tuple with the ImportOnly field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *CreateKeyPayload) GetImportOnlyOk() (ret CreateKeyPayloadgetImportOnlyRetType, ok bool) {
|
||||
return getCreateKeyPayloadgetImportOnlyAttributeTypeOk(o.ImportOnly)
|
||||
}
|
||||
|
||||
// HasImportOnly returns a boolean if a field has been set.
|
||||
func (o *CreateKeyPayload) HasImportOnly() bool {
|
||||
_, ok := o.GetImportOnlyOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetImportOnly gets a reference to the given bool and assigns it to the ImportOnly field.
|
||||
func (o *CreateKeyPayload) SetImportOnly(v CreateKeyPayloadgetImportOnlyRetType) {
|
||||
setCreateKeyPayloadgetImportOnlyAttributeType(&o.ImportOnly, v)
|
||||
}
|
||||
|
||||
// GetProtection returns the Protection field value if set, zero value otherwise.
|
||||
func (o *CreateKeyPayload) GetProtection() (res CreateKeyPayloadGetProtectionRetType) {
|
||||
res, _ = o.GetProtectionOk()
|
||||
return
|
||||
}
|
||||
|
||||
// GetProtectionOk returns a tuple with the Protection field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *CreateKeyPayload) GetProtectionOk() (ret CreateKeyPayloadGetProtectionRetType, ok bool) {
|
||||
return getCreateKeyPayloadGetProtectionAttributeTypeOk(o.Protection)
|
||||
}
|
||||
|
||||
// HasProtection returns a boolean if a field has been set.
|
||||
func (o *CreateKeyPayload) HasProtection() bool {
|
||||
_, ok := o.GetProtectionOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetProtection gets a reference to the given Protection and assigns it to the Protection field.
|
||||
func (o *CreateKeyPayload) SetProtection(v CreateKeyPayloadGetProtectionRetType) {
|
||||
setCreateKeyPayloadGetProtectionAttributeType(&o.Protection, v)
|
||||
}
|
||||
|
||||
// GetPurpose returns the Purpose field value
|
||||
func (o *CreateKeyPayload) GetPurpose() (ret CreateKeyPayloadGetPurposeRetType) {
|
||||
ret, _ = o.GetPurposeOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetPurposeOk returns a tuple with the Purpose field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *CreateKeyPayload) GetPurposeOk() (ret CreateKeyPayloadGetPurposeRetType, ok bool) {
|
||||
return getCreateKeyPayloadGetPurposeAttributeTypeOk(o.Purpose)
|
||||
}
|
||||
|
||||
// SetPurpose sets field value
|
||||
func (o *CreateKeyPayload) SetPurpose(v CreateKeyPayloadGetPurposeRetType) {
|
||||
setCreateKeyPayloadGetPurposeAttributeType(&o.Purpose, v)
|
||||
}
|
||||
|
||||
func (o CreateKeyPayload) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getCreateKeyPayloadGetAccessScopeAttributeTypeOk(o.AccessScope); ok {
|
||||
toSerialize["AccessScope"] = val
|
||||
}
|
||||
if val, ok := getCreateKeyPayloadGetAlgorithmAttributeTypeOk(o.Algorithm); ok {
|
||||
toSerialize["Algorithm"] = val
|
||||
}
|
||||
if val, ok := getCreateKeyPayloadGetBackendAttributeTypeOk(o.Backend); ok {
|
||||
toSerialize["Backend"] = val
|
||||
}
|
||||
if val, ok := getCreateKeyPayloadGetDescriptionAttributeTypeOk(o.Description); ok {
|
||||
toSerialize["Description"] = val
|
||||
}
|
||||
if val, ok := getCreateKeyPayloadGetDisplayNameAttributeTypeOk(o.DisplayName); ok {
|
||||
toSerialize["DisplayName"] = val
|
||||
}
|
||||
if val, ok := getCreateKeyPayloadgetImportOnlyAttributeTypeOk(o.ImportOnly); ok {
|
||||
toSerialize["ImportOnly"] = val
|
||||
}
|
||||
if val, ok := getCreateKeyPayloadGetProtectionAttributeTypeOk(o.Protection); ok {
|
||||
toSerialize["Protection"] = val
|
||||
}
|
||||
if val, ok := getCreateKeyPayloadGetPurposeAttributeTypeOk(o.Purpose); ok {
|
||||
toSerialize["Purpose"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableCreateKeyPayload struct {
|
||||
value *CreateKeyPayload
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableCreateKeyPayload) Get() *CreateKeyPayload {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableCreateKeyPayload) Set(val *CreateKeyPayload) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableCreateKeyPayload) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableCreateKeyPayload) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableCreateKeyPayload(val *CreateKeyPayload) *NullableCreateKeyPayload {
|
||||
return &NullableCreateKeyPayload{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableCreateKeyPayload) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableCreateKeyPayload) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
11
pkg/kmsbeta/model_create_key_payload_test.go
Normal file
11
pkg/kmsbeta/model_create_key_payload_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
176
pkg/kmsbeta/model_create_key_ring_payload.go
Normal file
176
pkg/kmsbeta/model_create_key_ring_payload.go
Normal file
|
|
@ -0,0 +1,176 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the CreateKeyRingPayload type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &CreateKeyRingPayload{}
|
||||
|
||||
/*
|
||||
types and functions for description
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type CreateKeyRingPayloadGetDescriptionAttributeType = *string
|
||||
|
||||
func getCreateKeyRingPayloadGetDescriptionAttributeTypeOk(arg CreateKeyRingPayloadGetDescriptionAttributeType) (ret CreateKeyRingPayloadGetDescriptionRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setCreateKeyRingPayloadGetDescriptionAttributeType(arg *CreateKeyRingPayloadGetDescriptionAttributeType, val CreateKeyRingPayloadGetDescriptionRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type CreateKeyRingPayloadGetDescriptionArgType = string
|
||||
type CreateKeyRingPayloadGetDescriptionRetType = string
|
||||
|
||||
/*
|
||||
types and functions for displayName
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type CreateKeyRingPayloadGetDisplayNameAttributeType = *string
|
||||
|
||||
func getCreateKeyRingPayloadGetDisplayNameAttributeTypeOk(arg CreateKeyRingPayloadGetDisplayNameAttributeType) (ret CreateKeyRingPayloadGetDisplayNameRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setCreateKeyRingPayloadGetDisplayNameAttributeType(arg *CreateKeyRingPayloadGetDisplayNameAttributeType, val CreateKeyRingPayloadGetDisplayNameRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type CreateKeyRingPayloadGetDisplayNameArgType = string
|
||||
type CreateKeyRingPayloadGetDisplayNameRetType = string
|
||||
|
||||
// CreateKeyRingPayload struct for CreateKeyRingPayload
|
||||
type CreateKeyRingPayload struct {
|
||||
// A user chosen description to distinguish multiple key rings.
|
||||
Description CreateKeyRingPayloadGetDescriptionAttributeType `json:"description,omitempty"`
|
||||
// The display name to distinguish multiple key rings. Valid characters: letters, digits, underscores and hyphens.
|
||||
// REQUIRED
|
||||
DisplayName CreateKeyRingPayloadGetDisplayNameAttributeType `json:"displayName" required:"true"`
|
||||
}
|
||||
|
||||
type _CreateKeyRingPayload CreateKeyRingPayload
|
||||
|
||||
// NewCreateKeyRingPayload instantiates a new CreateKeyRingPayload 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 NewCreateKeyRingPayload(displayName CreateKeyRingPayloadGetDisplayNameArgType) *CreateKeyRingPayload {
|
||||
this := CreateKeyRingPayload{}
|
||||
setCreateKeyRingPayloadGetDisplayNameAttributeType(&this.DisplayName, displayName)
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewCreateKeyRingPayloadWithDefaults instantiates a new CreateKeyRingPayload 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 NewCreateKeyRingPayloadWithDefaults() *CreateKeyRingPayload {
|
||||
this := CreateKeyRingPayload{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetDescription returns the Description field value if set, zero value otherwise.
|
||||
func (o *CreateKeyRingPayload) GetDescription() (res CreateKeyRingPayloadGetDescriptionRetType) {
|
||||
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 *CreateKeyRingPayload) GetDescriptionOk() (ret CreateKeyRingPayloadGetDescriptionRetType, ok bool) {
|
||||
return getCreateKeyRingPayloadGetDescriptionAttributeTypeOk(o.Description)
|
||||
}
|
||||
|
||||
// HasDescription returns a boolean if a field has been set.
|
||||
func (o *CreateKeyRingPayload) HasDescription() bool {
|
||||
_, ok := o.GetDescriptionOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetDescription gets a reference to the given string and assigns it to the Description field.
|
||||
func (o *CreateKeyRingPayload) SetDescription(v CreateKeyRingPayloadGetDescriptionRetType) {
|
||||
setCreateKeyRingPayloadGetDescriptionAttributeType(&o.Description, v)
|
||||
}
|
||||
|
||||
// GetDisplayName returns the DisplayName field value
|
||||
func (o *CreateKeyRingPayload) GetDisplayName() (ret CreateKeyRingPayloadGetDisplayNameRetType) {
|
||||
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 *CreateKeyRingPayload) GetDisplayNameOk() (ret CreateKeyRingPayloadGetDisplayNameRetType, ok bool) {
|
||||
return getCreateKeyRingPayloadGetDisplayNameAttributeTypeOk(o.DisplayName)
|
||||
}
|
||||
|
||||
// SetDisplayName sets field value
|
||||
func (o *CreateKeyRingPayload) SetDisplayName(v CreateKeyRingPayloadGetDisplayNameRetType) {
|
||||
setCreateKeyRingPayloadGetDisplayNameAttributeType(&o.DisplayName, v)
|
||||
}
|
||||
|
||||
func (o CreateKeyRingPayload) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getCreateKeyRingPayloadGetDescriptionAttributeTypeOk(o.Description); ok {
|
||||
toSerialize["Description"] = val
|
||||
}
|
||||
if val, ok := getCreateKeyRingPayloadGetDisplayNameAttributeTypeOk(o.DisplayName); ok {
|
||||
toSerialize["DisplayName"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableCreateKeyRingPayload struct {
|
||||
value *CreateKeyRingPayload
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableCreateKeyRingPayload) Get() *CreateKeyRingPayload {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableCreateKeyRingPayload) Set(val *CreateKeyRingPayload) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableCreateKeyRingPayload) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableCreateKeyRingPayload) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableCreateKeyRingPayload(val *CreateKeyRingPayload) *NullableCreateKeyRingPayload {
|
||||
return &NullableCreateKeyRingPayload{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableCreateKeyRingPayload) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableCreateKeyRingPayload) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
11
pkg/kmsbeta/model_create_key_ring_payload_test.go
Normal file
11
pkg/kmsbeta/model_create_key_ring_payload_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
405
pkg/kmsbeta/model_create_wrapping_key_payload.go
Normal file
405
pkg/kmsbeta/model_create_wrapping_key_payload.go
Normal file
|
|
@ -0,0 +1,405 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the CreateWrappingKeyPayload type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &CreateWrappingKeyPayload{}
|
||||
|
||||
/*
|
||||
types and functions for access_scope
|
||||
*/
|
||||
|
||||
// isEnumRef
|
||||
type CreateWrappingKeyPayloadGetAccessScopeAttributeType = *AccessScope
|
||||
type CreateWrappingKeyPayloadGetAccessScopeArgType = AccessScope
|
||||
type CreateWrappingKeyPayloadGetAccessScopeRetType = AccessScope
|
||||
|
||||
func getCreateWrappingKeyPayloadGetAccessScopeAttributeTypeOk(arg CreateWrappingKeyPayloadGetAccessScopeAttributeType) (ret CreateWrappingKeyPayloadGetAccessScopeRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setCreateWrappingKeyPayloadGetAccessScopeAttributeType(arg *CreateWrappingKeyPayloadGetAccessScopeAttributeType, val CreateWrappingKeyPayloadGetAccessScopeRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for algorithm
|
||||
*/
|
||||
|
||||
// isEnumRef
|
||||
type CreateWrappingKeyPayloadGetAlgorithmAttributeType = *WrappingAlgorithm
|
||||
type CreateWrappingKeyPayloadGetAlgorithmArgType = WrappingAlgorithm
|
||||
type CreateWrappingKeyPayloadGetAlgorithmRetType = WrappingAlgorithm
|
||||
|
||||
func getCreateWrappingKeyPayloadGetAlgorithmAttributeTypeOk(arg CreateWrappingKeyPayloadGetAlgorithmAttributeType) (ret CreateWrappingKeyPayloadGetAlgorithmRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setCreateWrappingKeyPayloadGetAlgorithmAttributeType(arg *CreateWrappingKeyPayloadGetAlgorithmAttributeType, val CreateWrappingKeyPayloadGetAlgorithmRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for backend
|
||||
*/
|
||||
|
||||
// isEnumRef
|
||||
type CreateWrappingKeyPayloadGetBackendAttributeType = *Backend
|
||||
type CreateWrappingKeyPayloadGetBackendArgType = Backend
|
||||
type CreateWrappingKeyPayloadGetBackendRetType = Backend
|
||||
|
||||
func getCreateWrappingKeyPayloadGetBackendAttributeTypeOk(arg CreateWrappingKeyPayloadGetBackendAttributeType) (ret CreateWrappingKeyPayloadGetBackendRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setCreateWrappingKeyPayloadGetBackendAttributeType(arg *CreateWrappingKeyPayloadGetBackendAttributeType, val CreateWrappingKeyPayloadGetBackendRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for description
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type CreateWrappingKeyPayloadGetDescriptionAttributeType = *string
|
||||
|
||||
func getCreateWrappingKeyPayloadGetDescriptionAttributeTypeOk(arg CreateWrappingKeyPayloadGetDescriptionAttributeType) (ret CreateWrappingKeyPayloadGetDescriptionRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setCreateWrappingKeyPayloadGetDescriptionAttributeType(arg *CreateWrappingKeyPayloadGetDescriptionAttributeType, val CreateWrappingKeyPayloadGetDescriptionRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type CreateWrappingKeyPayloadGetDescriptionArgType = string
|
||||
type CreateWrappingKeyPayloadGetDescriptionRetType = string
|
||||
|
||||
/*
|
||||
types and functions for displayName
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type CreateWrappingKeyPayloadGetDisplayNameAttributeType = *string
|
||||
|
||||
func getCreateWrappingKeyPayloadGetDisplayNameAttributeTypeOk(arg CreateWrappingKeyPayloadGetDisplayNameAttributeType) (ret CreateWrappingKeyPayloadGetDisplayNameRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setCreateWrappingKeyPayloadGetDisplayNameAttributeType(arg *CreateWrappingKeyPayloadGetDisplayNameAttributeType, val CreateWrappingKeyPayloadGetDisplayNameRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type CreateWrappingKeyPayloadGetDisplayNameArgType = string
|
||||
type CreateWrappingKeyPayloadGetDisplayNameRetType = string
|
||||
|
||||
/*
|
||||
types and functions for protection
|
||||
*/
|
||||
|
||||
// isEnumRef
|
||||
type CreateWrappingKeyPayloadGetProtectionAttributeType = *Protection
|
||||
type CreateWrappingKeyPayloadGetProtectionArgType = Protection
|
||||
type CreateWrappingKeyPayloadGetProtectionRetType = Protection
|
||||
|
||||
func getCreateWrappingKeyPayloadGetProtectionAttributeTypeOk(arg CreateWrappingKeyPayloadGetProtectionAttributeType) (ret CreateWrappingKeyPayloadGetProtectionRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setCreateWrappingKeyPayloadGetProtectionAttributeType(arg *CreateWrappingKeyPayloadGetProtectionAttributeType, val CreateWrappingKeyPayloadGetProtectionRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for purpose
|
||||
*/
|
||||
|
||||
// isEnumRef
|
||||
type CreateWrappingKeyPayloadGetPurposeAttributeType = *WrappingPurpose
|
||||
type CreateWrappingKeyPayloadGetPurposeArgType = WrappingPurpose
|
||||
type CreateWrappingKeyPayloadGetPurposeRetType = WrappingPurpose
|
||||
|
||||
func getCreateWrappingKeyPayloadGetPurposeAttributeTypeOk(arg CreateWrappingKeyPayloadGetPurposeAttributeType) (ret CreateWrappingKeyPayloadGetPurposeRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setCreateWrappingKeyPayloadGetPurposeAttributeType(arg *CreateWrappingKeyPayloadGetPurposeAttributeType, val CreateWrappingKeyPayloadGetPurposeRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
// CreateWrappingKeyPayload struct for CreateWrappingKeyPayload
|
||||
type CreateWrappingKeyPayload struct {
|
||||
AccessScope CreateWrappingKeyPayloadGetAccessScopeAttributeType `json:"access_scope,omitempty"`
|
||||
// REQUIRED
|
||||
Algorithm CreateWrappingKeyPayloadGetAlgorithmAttributeType `json:"algorithm" required:"true"`
|
||||
// Deprecated: Check the GitHub changelog for alternatives
|
||||
// REQUIRED
|
||||
Backend CreateWrappingKeyPayloadGetBackendAttributeType `json:"backend" required:"true"`
|
||||
// A user chosen description to distinguish multiple wrapping keys.
|
||||
Description CreateWrappingKeyPayloadGetDescriptionAttributeType `json:"description,omitempty"`
|
||||
// The display name to distinguish multiple wrapping keys. Valid characters: letters, digits, underscores and hyphens.
|
||||
// REQUIRED
|
||||
DisplayName CreateWrappingKeyPayloadGetDisplayNameAttributeType `json:"displayName" required:"true"`
|
||||
Protection CreateWrappingKeyPayloadGetProtectionAttributeType `json:"protection,omitempty"`
|
||||
// REQUIRED
|
||||
Purpose CreateWrappingKeyPayloadGetPurposeAttributeType `json:"purpose" required:"true"`
|
||||
}
|
||||
|
||||
type _CreateWrappingKeyPayload CreateWrappingKeyPayload
|
||||
|
||||
// NewCreateWrappingKeyPayload instantiates a new CreateWrappingKeyPayload 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 NewCreateWrappingKeyPayload(algorithm CreateWrappingKeyPayloadGetAlgorithmArgType, backend CreateWrappingKeyPayloadGetBackendArgType, displayName CreateWrappingKeyPayloadGetDisplayNameArgType, purpose CreateWrappingKeyPayloadGetPurposeArgType) *CreateWrappingKeyPayload {
|
||||
this := CreateWrappingKeyPayload{}
|
||||
setCreateWrappingKeyPayloadGetAlgorithmAttributeType(&this.Algorithm, algorithm)
|
||||
setCreateWrappingKeyPayloadGetBackendAttributeType(&this.Backend, backend)
|
||||
setCreateWrappingKeyPayloadGetDisplayNameAttributeType(&this.DisplayName, displayName)
|
||||
setCreateWrappingKeyPayloadGetPurposeAttributeType(&this.Purpose, purpose)
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewCreateWrappingKeyPayloadWithDefaults instantiates a new CreateWrappingKeyPayload 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 NewCreateWrappingKeyPayloadWithDefaults() *CreateWrappingKeyPayload {
|
||||
this := CreateWrappingKeyPayload{}
|
||||
var accessScope AccessScope = ACCESSSCOPE_PUBLIC
|
||||
this.AccessScope = &accessScope
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetAccessScope returns the AccessScope field value if set, zero value otherwise.
|
||||
func (o *CreateWrappingKeyPayload) GetAccessScope() (res CreateWrappingKeyPayloadGetAccessScopeRetType) {
|
||||
res, _ = o.GetAccessScopeOk()
|
||||
return
|
||||
}
|
||||
|
||||
// GetAccessScopeOk returns a tuple with the AccessScope field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *CreateWrappingKeyPayload) GetAccessScopeOk() (ret CreateWrappingKeyPayloadGetAccessScopeRetType, ok bool) {
|
||||
return getCreateWrappingKeyPayloadGetAccessScopeAttributeTypeOk(o.AccessScope)
|
||||
}
|
||||
|
||||
// HasAccessScope returns a boolean if a field has been set.
|
||||
func (o *CreateWrappingKeyPayload) HasAccessScope() bool {
|
||||
_, ok := o.GetAccessScopeOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetAccessScope gets a reference to the given AccessScope and assigns it to the AccessScope field.
|
||||
func (o *CreateWrappingKeyPayload) SetAccessScope(v CreateWrappingKeyPayloadGetAccessScopeRetType) {
|
||||
setCreateWrappingKeyPayloadGetAccessScopeAttributeType(&o.AccessScope, v)
|
||||
}
|
||||
|
||||
// GetAlgorithm returns the Algorithm field value
|
||||
func (o *CreateWrappingKeyPayload) GetAlgorithm() (ret CreateWrappingKeyPayloadGetAlgorithmRetType) {
|
||||
ret, _ = o.GetAlgorithmOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetAlgorithmOk returns a tuple with the Algorithm field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *CreateWrappingKeyPayload) GetAlgorithmOk() (ret CreateWrappingKeyPayloadGetAlgorithmRetType, ok bool) {
|
||||
return getCreateWrappingKeyPayloadGetAlgorithmAttributeTypeOk(o.Algorithm)
|
||||
}
|
||||
|
||||
// SetAlgorithm sets field value
|
||||
func (o *CreateWrappingKeyPayload) SetAlgorithm(v CreateWrappingKeyPayloadGetAlgorithmRetType) {
|
||||
setCreateWrappingKeyPayloadGetAlgorithmAttributeType(&o.Algorithm, v)
|
||||
}
|
||||
|
||||
// GetBackend returns the Backend field value
|
||||
// Deprecated
|
||||
func (o *CreateWrappingKeyPayload) GetBackend() (ret CreateWrappingKeyPayloadGetBackendRetType) {
|
||||
ret, _ = o.GetBackendOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetBackendOk returns a tuple with the Backend field value
|
||||
// and a boolean to check if the value has been set.
|
||||
// Deprecated
|
||||
func (o *CreateWrappingKeyPayload) GetBackendOk() (ret CreateWrappingKeyPayloadGetBackendRetType, ok bool) {
|
||||
return getCreateWrappingKeyPayloadGetBackendAttributeTypeOk(o.Backend)
|
||||
}
|
||||
|
||||
// SetBackend sets field value
|
||||
// Deprecated
|
||||
func (o *CreateWrappingKeyPayload) SetBackend(v CreateWrappingKeyPayloadGetBackendRetType) {
|
||||
setCreateWrappingKeyPayloadGetBackendAttributeType(&o.Backend, v)
|
||||
}
|
||||
|
||||
// GetDescription returns the Description field value if set, zero value otherwise.
|
||||
func (o *CreateWrappingKeyPayload) GetDescription() (res CreateWrappingKeyPayloadGetDescriptionRetType) {
|
||||
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 *CreateWrappingKeyPayload) GetDescriptionOk() (ret CreateWrappingKeyPayloadGetDescriptionRetType, ok bool) {
|
||||
return getCreateWrappingKeyPayloadGetDescriptionAttributeTypeOk(o.Description)
|
||||
}
|
||||
|
||||
// HasDescription returns a boolean if a field has been set.
|
||||
func (o *CreateWrappingKeyPayload) HasDescription() bool {
|
||||
_, ok := o.GetDescriptionOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetDescription gets a reference to the given string and assigns it to the Description field.
|
||||
func (o *CreateWrappingKeyPayload) SetDescription(v CreateWrappingKeyPayloadGetDescriptionRetType) {
|
||||
setCreateWrappingKeyPayloadGetDescriptionAttributeType(&o.Description, v)
|
||||
}
|
||||
|
||||
// GetDisplayName returns the DisplayName field value
|
||||
func (o *CreateWrappingKeyPayload) GetDisplayName() (ret CreateWrappingKeyPayloadGetDisplayNameRetType) {
|
||||
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 *CreateWrappingKeyPayload) GetDisplayNameOk() (ret CreateWrappingKeyPayloadGetDisplayNameRetType, ok bool) {
|
||||
return getCreateWrappingKeyPayloadGetDisplayNameAttributeTypeOk(o.DisplayName)
|
||||
}
|
||||
|
||||
// SetDisplayName sets field value
|
||||
func (o *CreateWrappingKeyPayload) SetDisplayName(v CreateWrappingKeyPayloadGetDisplayNameRetType) {
|
||||
setCreateWrappingKeyPayloadGetDisplayNameAttributeType(&o.DisplayName, v)
|
||||
}
|
||||
|
||||
// GetProtection returns the Protection field value if set, zero value otherwise.
|
||||
func (o *CreateWrappingKeyPayload) GetProtection() (res CreateWrappingKeyPayloadGetProtectionRetType) {
|
||||
res, _ = o.GetProtectionOk()
|
||||
return
|
||||
}
|
||||
|
||||
// GetProtectionOk returns a tuple with the Protection field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *CreateWrappingKeyPayload) GetProtectionOk() (ret CreateWrappingKeyPayloadGetProtectionRetType, ok bool) {
|
||||
return getCreateWrappingKeyPayloadGetProtectionAttributeTypeOk(o.Protection)
|
||||
}
|
||||
|
||||
// HasProtection returns a boolean if a field has been set.
|
||||
func (o *CreateWrappingKeyPayload) HasProtection() bool {
|
||||
_, ok := o.GetProtectionOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetProtection gets a reference to the given Protection and assigns it to the Protection field.
|
||||
func (o *CreateWrappingKeyPayload) SetProtection(v CreateWrappingKeyPayloadGetProtectionRetType) {
|
||||
setCreateWrappingKeyPayloadGetProtectionAttributeType(&o.Protection, v)
|
||||
}
|
||||
|
||||
// GetPurpose returns the Purpose field value
|
||||
func (o *CreateWrappingKeyPayload) GetPurpose() (ret CreateWrappingKeyPayloadGetPurposeRetType) {
|
||||
ret, _ = o.GetPurposeOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetPurposeOk returns a tuple with the Purpose field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *CreateWrappingKeyPayload) GetPurposeOk() (ret CreateWrappingKeyPayloadGetPurposeRetType, ok bool) {
|
||||
return getCreateWrappingKeyPayloadGetPurposeAttributeTypeOk(o.Purpose)
|
||||
}
|
||||
|
||||
// SetPurpose sets field value
|
||||
func (o *CreateWrappingKeyPayload) SetPurpose(v CreateWrappingKeyPayloadGetPurposeRetType) {
|
||||
setCreateWrappingKeyPayloadGetPurposeAttributeType(&o.Purpose, v)
|
||||
}
|
||||
|
||||
func (o CreateWrappingKeyPayload) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getCreateWrappingKeyPayloadGetAccessScopeAttributeTypeOk(o.AccessScope); ok {
|
||||
toSerialize["AccessScope"] = val
|
||||
}
|
||||
if val, ok := getCreateWrappingKeyPayloadGetAlgorithmAttributeTypeOk(o.Algorithm); ok {
|
||||
toSerialize["Algorithm"] = val
|
||||
}
|
||||
if val, ok := getCreateWrappingKeyPayloadGetBackendAttributeTypeOk(o.Backend); ok {
|
||||
toSerialize["Backend"] = val
|
||||
}
|
||||
if val, ok := getCreateWrappingKeyPayloadGetDescriptionAttributeTypeOk(o.Description); ok {
|
||||
toSerialize["Description"] = val
|
||||
}
|
||||
if val, ok := getCreateWrappingKeyPayloadGetDisplayNameAttributeTypeOk(o.DisplayName); ok {
|
||||
toSerialize["DisplayName"] = val
|
||||
}
|
||||
if val, ok := getCreateWrappingKeyPayloadGetProtectionAttributeTypeOk(o.Protection); ok {
|
||||
toSerialize["Protection"] = val
|
||||
}
|
||||
if val, ok := getCreateWrappingKeyPayloadGetPurposeAttributeTypeOk(o.Purpose); ok {
|
||||
toSerialize["Purpose"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableCreateWrappingKeyPayload struct {
|
||||
value *CreateWrappingKeyPayload
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableCreateWrappingKeyPayload) Get() *CreateWrappingKeyPayload {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableCreateWrappingKeyPayload) Set(val *CreateWrappingKeyPayload) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableCreateWrappingKeyPayload) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableCreateWrappingKeyPayload) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableCreateWrappingKeyPayload(val *CreateWrappingKeyPayload) *NullableCreateWrappingKeyPayload {
|
||||
return &NullableCreateWrappingKeyPayload{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableCreateWrappingKeyPayload) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableCreateWrappingKeyPayload) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
11
pkg/kmsbeta/model_create_wrapping_key_payload_test.go
Normal file
11
pkg/kmsbeta/model_create_wrapping_key_payload_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
126
pkg/kmsbeta/model_decrypt_payload.go
Normal file
126
pkg/kmsbeta/model_decrypt_payload.go
Normal file
|
|
@ -0,0 +1,126 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the DecryptPayload type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &DecryptPayload{}
|
||||
|
||||
/*
|
||||
types and functions for data
|
||||
*/
|
||||
|
||||
// isByteArray
|
||||
type DecryptPayloadGetDataAttributeType = *[]byte
|
||||
type DecryptPayloadGetDataArgType = []byte
|
||||
type DecryptPayloadGetDataRetType = []byte
|
||||
|
||||
func getDecryptPayloadGetDataAttributeTypeOk(arg DecryptPayloadGetDataAttributeType) (ret DecryptPayloadGetDataRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setDecryptPayloadGetDataAttributeType(arg *DecryptPayloadGetDataAttributeType, val DecryptPayloadGetDataRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
// DecryptPayload struct for DecryptPayload
|
||||
type DecryptPayload struct {
|
||||
// The data that has to be decrypted. Encoded in base64.
|
||||
// REQUIRED
|
||||
Data DecryptPayloadGetDataAttributeType `json:"data" required:"true"`
|
||||
}
|
||||
|
||||
type _DecryptPayload DecryptPayload
|
||||
|
||||
// NewDecryptPayload instantiates a new DecryptPayload 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 NewDecryptPayload(data DecryptPayloadGetDataArgType) *DecryptPayload {
|
||||
this := DecryptPayload{}
|
||||
setDecryptPayloadGetDataAttributeType(&this.Data, data)
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewDecryptPayloadWithDefaults instantiates a new DecryptPayload 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 NewDecryptPayloadWithDefaults() *DecryptPayload {
|
||||
this := DecryptPayload{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetData returns the Data field value
|
||||
func (o *DecryptPayload) GetData() (ret DecryptPayloadGetDataRetType) {
|
||||
ret, _ = o.GetDataOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetDataOk returns a tuple with the Data field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *DecryptPayload) GetDataOk() (ret DecryptPayloadGetDataRetType, ok bool) {
|
||||
return getDecryptPayloadGetDataAttributeTypeOk(o.Data)
|
||||
}
|
||||
|
||||
// SetData sets field value
|
||||
func (o *DecryptPayload) SetData(v DecryptPayloadGetDataRetType) {
|
||||
setDecryptPayloadGetDataAttributeType(&o.Data, v)
|
||||
}
|
||||
|
||||
func (o DecryptPayload) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getDecryptPayloadGetDataAttributeTypeOk(o.Data); ok {
|
||||
toSerialize["Data"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableDecryptPayload struct {
|
||||
value *DecryptPayload
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableDecryptPayload) Get() *DecryptPayload {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableDecryptPayload) Set(val *DecryptPayload) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableDecryptPayload) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableDecryptPayload) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableDecryptPayload(val *DecryptPayload) *NullableDecryptPayload {
|
||||
return &NullableDecryptPayload{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableDecryptPayload) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableDecryptPayload) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
11
pkg/kmsbeta/model_decrypt_payload_test.go
Normal file
11
pkg/kmsbeta/model_decrypt_payload_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
126
pkg/kmsbeta/model_decrypted_data.go
Normal file
126
pkg/kmsbeta/model_decrypted_data.go
Normal file
|
|
@ -0,0 +1,126 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the DecryptedData type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &DecryptedData{}
|
||||
|
||||
/*
|
||||
types and functions for data
|
||||
*/
|
||||
|
||||
// isByteArray
|
||||
type DecryptedDataGetDataAttributeType = *[]byte
|
||||
type DecryptedDataGetDataArgType = []byte
|
||||
type DecryptedDataGetDataRetType = []byte
|
||||
|
||||
func getDecryptedDataGetDataAttributeTypeOk(arg DecryptedDataGetDataAttributeType) (ret DecryptedDataGetDataRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setDecryptedDataGetDataAttributeType(arg *DecryptedDataGetDataAttributeType, val DecryptedDataGetDataRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
// DecryptedData struct for DecryptedData
|
||||
type DecryptedData struct {
|
||||
// The decrypted data. Encoded in base64.
|
||||
// REQUIRED
|
||||
Data DecryptedDataGetDataAttributeType `json:"data" required:"true"`
|
||||
}
|
||||
|
||||
type _DecryptedData DecryptedData
|
||||
|
||||
// NewDecryptedData instantiates a new DecryptedData 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 NewDecryptedData(data DecryptedDataGetDataArgType) *DecryptedData {
|
||||
this := DecryptedData{}
|
||||
setDecryptedDataGetDataAttributeType(&this.Data, data)
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewDecryptedDataWithDefaults instantiates a new DecryptedData 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 NewDecryptedDataWithDefaults() *DecryptedData {
|
||||
this := DecryptedData{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetData returns the Data field value
|
||||
func (o *DecryptedData) GetData() (ret DecryptedDataGetDataRetType) {
|
||||
ret, _ = o.GetDataOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetDataOk returns a tuple with the Data field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *DecryptedData) GetDataOk() (ret DecryptedDataGetDataRetType, ok bool) {
|
||||
return getDecryptedDataGetDataAttributeTypeOk(o.Data)
|
||||
}
|
||||
|
||||
// SetData sets field value
|
||||
func (o *DecryptedData) SetData(v DecryptedDataGetDataRetType) {
|
||||
setDecryptedDataGetDataAttributeType(&o.Data, v)
|
||||
}
|
||||
|
||||
func (o DecryptedData) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getDecryptedDataGetDataAttributeTypeOk(o.Data); ok {
|
||||
toSerialize["Data"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableDecryptedData struct {
|
||||
value *DecryptedData
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableDecryptedData) Get() *DecryptedData {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableDecryptedData) Set(val *DecryptedData) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableDecryptedData) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableDecryptedData) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableDecryptedData(val *DecryptedData) *NullableDecryptedData {
|
||||
return &NullableDecryptedData{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableDecryptedData) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableDecryptedData) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
11
pkg/kmsbeta/model_decrypted_data_test.go
Normal file
11
pkg/kmsbeta/model_decrypted_data_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
126
pkg/kmsbeta/model_encrypt_payload.go
Normal file
126
pkg/kmsbeta/model_encrypt_payload.go
Normal file
|
|
@ -0,0 +1,126 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the EncryptPayload type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &EncryptPayload{}
|
||||
|
||||
/*
|
||||
types and functions for data
|
||||
*/
|
||||
|
||||
// isByteArray
|
||||
type EncryptPayloadGetDataAttributeType = *[]byte
|
||||
type EncryptPayloadGetDataArgType = []byte
|
||||
type EncryptPayloadGetDataRetType = []byte
|
||||
|
||||
func getEncryptPayloadGetDataAttributeTypeOk(arg EncryptPayloadGetDataAttributeType) (ret EncryptPayloadGetDataRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setEncryptPayloadGetDataAttributeType(arg *EncryptPayloadGetDataAttributeType, val EncryptPayloadGetDataRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
// EncryptPayload struct for EncryptPayload
|
||||
type EncryptPayload struct {
|
||||
// The data that has to be encrypted. Encoded in base64.
|
||||
// REQUIRED
|
||||
Data EncryptPayloadGetDataAttributeType `json:"data" required:"true"`
|
||||
}
|
||||
|
||||
type _EncryptPayload EncryptPayload
|
||||
|
||||
// NewEncryptPayload instantiates a new EncryptPayload 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 NewEncryptPayload(data EncryptPayloadGetDataArgType) *EncryptPayload {
|
||||
this := EncryptPayload{}
|
||||
setEncryptPayloadGetDataAttributeType(&this.Data, data)
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewEncryptPayloadWithDefaults instantiates a new EncryptPayload 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 NewEncryptPayloadWithDefaults() *EncryptPayload {
|
||||
this := EncryptPayload{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetData returns the Data field value
|
||||
func (o *EncryptPayload) GetData() (ret EncryptPayloadGetDataRetType) {
|
||||
ret, _ = o.GetDataOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetDataOk returns a tuple with the Data field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *EncryptPayload) GetDataOk() (ret EncryptPayloadGetDataRetType, ok bool) {
|
||||
return getEncryptPayloadGetDataAttributeTypeOk(o.Data)
|
||||
}
|
||||
|
||||
// SetData sets field value
|
||||
func (o *EncryptPayload) SetData(v EncryptPayloadGetDataRetType) {
|
||||
setEncryptPayloadGetDataAttributeType(&o.Data, v)
|
||||
}
|
||||
|
||||
func (o EncryptPayload) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getEncryptPayloadGetDataAttributeTypeOk(o.Data); ok {
|
||||
toSerialize["Data"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableEncryptPayload struct {
|
||||
value *EncryptPayload
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableEncryptPayload) Get() *EncryptPayload {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableEncryptPayload) Set(val *EncryptPayload) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableEncryptPayload) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableEncryptPayload) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableEncryptPayload(val *EncryptPayload) *NullableEncryptPayload {
|
||||
return &NullableEncryptPayload{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableEncryptPayload) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableEncryptPayload) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
11
pkg/kmsbeta/model_encrypt_payload_test.go
Normal file
11
pkg/kmsbeta/model_encrypt_payload_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
126
pkg/kmsbeta/model_encrypted_data.go
Normal file
126
pkg/kmsbeta/model_encrypted_data.go
Normal file
|
|
@ -0,0 +1,126 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the EncryptedData type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &EncryptedData{}
|
||||
|
||||
/*
|
||||
types and functions for data
|
||||
*/
|
||||
|
||||
// isByteArray
|
||||
type EncryptedDataGetDataAttributeType = *[]byte
|
||||
type EncryptedDataGetDataArgType = []byte
|
||||
type EncryptedDataGetDataRetType = []byte
|
||||
|
||||
func getEncryptedDataGetDataAttributeTypeOk(arg EncryptedDataGetDataAttributeType) (ret EncryptedDataGetDataRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setEncryptedDataGetDataAttributeType(arg *EncryptedDataGetDataAttributeType, val EncryptedDataGetDataRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
// EncryptedData struct for EncryptedData
|
||||
type EncryptedData struct {
|
||||
// The encrypted data. Encoded in base64.
|
||||
// REQUIRED
|
||||
Data EncryptedDataGetDataAttributeType `json:"data" required:"true"`
|
||||
}
|
||||
|
||||
type _EncryptedData EncryptedData
|
||||
|
||||
// NewEncryptedData instantiates a new EncryptedData 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 NewEncryptedData(data EncryptedDataGetDataArgType) *EncryptedData {
|
||||
this := EncryptedData{}
|
||||
setEncryptedDataGetDataAttributeType(&this.Data, data)
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewEncryptedDataWithDefaults instantiates a new EncryptedData 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 NewEncryptedDataWithDefaults() *EncryptedData {
|
||||
this := EncryptedData{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetData returns the Data field value
|
||||
func (o *EncryptedData) GetData() (ret EncryptedDataGetDataRetType) {
|
||||
ret, _ = o.GetDataOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetDataOk returns a tuple with the Data field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *EncryptedData) GetDataOk() (ret EncryptedDataGetDataRetType, ok bool) {
|
||||
return getEncryptedDataGetDataAttributeTypeOk(o.Data)
|
||||
}
|
||||
|
||||
// SetData sets field value
|
||||
func (o *EncryptedData) SetData(v EncryptedDataGetDataRetType) {
|
||||
setEncryptedDataGetDataAttributeType(&o.Data, v)
|
||||
}
|
||||
|
||||
func (o EncryptedData) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getEncryptedDataGetDataAttributeTypeOk(o.Data); ok {
|
||||
toSerialize["Data"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableEncryptedData struct {
|
||||
value *EncryptedData
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableEncryptedData) Get() *EncryptedData {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableEncryptedData) Set(val *EncryptedData) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableEncryptedData) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableEncryptedData) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableEncryptedData(val *EncryptedData) *NullableEncryptedData {
|
||||
return &NullableEncryptedData{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableEncryptedData) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableEncryptedData) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
11
pkg/kmsbeta/model_encrypted_data_test.go
Normal file
11
pkg/kmsbeta/model_encrypted_data_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
127
pkg/kmsbeta/model_http_error.go
Normal file
127
pkg/kmsbeta/model_http_error.go
Normal file
|
|
@ -0,0 +1,127 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the HttpError type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &HttpError{}
|
||||
|
||||
/*
|
||||
types and functions for message
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type HttpErrorGetMessageAttributeType = *string
|
||||
|
||||
func getHttpErrorGetMessageAttributeTypeOk(arg HttpErrorGetMessageAttributeType) (ret HttpErrorGetMessageRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setHttpErrorGetMessageAttributeType(arg *HttpErrorGetMessageAttributeType, val HttpErrorGetMessageRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type HttpErrorGetMessageArgType = string
|
||||
type HttpErrorGetMessageRetType = string
|
||||
|
||||
// HttpError struct for HttpError
|
||||
type HttpError struct {
|
||||
// A string that gives a short information about what went wrong.
|
||||
// REQUIRED
|
||||
Message HttpErrorGetMessageAttributeType `json:"message" required:"true"`
|
||||
}
|
||||
|
||||
type _HttpError HttpError
|
||||
|
||||
// NewHttpError instantiates a new HttpError 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 NewHttpError(message HttpErrorGetMessageArgType) *HttpError {
|
||||
this := HttpError{}
|
||||
setHttpErrorGetMessageAttributeType(&this.Message, message)
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewHttpErrorWithDefaults instantiates a new HttpError 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 NewHttpErrorWithDefaults() *HttpError {
|
||||
this := HttpError{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetMessage returns the Message field value
|
||||
func (o *HttpError) GetMessage() (ret HttpErrorGetMessageRetType) {
|
||||
ret, _ = o.GetMessageOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetMessageOk returns a tuple with the Message field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *HttpError) GetMessageOk() (ret HttpErrorGetMessageRetType, ok bool) {
|
||||
return getHttpErrorGetMessageAttributeTypeOk(o.Message)
|
||||
}
|
||||
|
||||
// SetMessage sets field value
|
||||
func (o *HttpError) SetMessage(v HttpErrorGetMessageRetType) {
|
||||
setHttpErrorGetMessageAttributeType(&o.Message, v)
|
||||
}
|
||||
|
||||
func (o HttpError) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getHttpErrorGetMessageAttributeTypeOk(o.Message); ok {
|
||||
toSerialize["Message"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableHttpError struct {
|
||||
value *HttpError
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableHttpError) Get() *HttpError {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableHttpError) Set(val *HttpError) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableHttpError) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableHttpError) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableHttpError(val *HttpError) *NullableHttpError {
|
||||
return &NullableHttpError{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableHttpError) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableHttpError) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
11
pkg/kmsbeta/model_http_error_test.go
Normal file
11
pkg/kmsbeta/model_http_error_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
172
pkg/kmsbeta/model_import_key_payload.go
Normal file
172
pkg/kmsbeta/model_import_key_payload.go
Normal file
|
|
@ -0,0 +1,172 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the ImportKeyPayload type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &ImportKeyPayload{}
|
||||
|
||||
/*
|
||||
types and functions for wrappedKey
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type ImportKeyPayloadGetWrappedKeyAttributeType = *string
|
||||
|
||||
func getImportKeyPayloadGetWrappedKeyAttributeTypeOk(arg ImportKeyPayloadGetWrappedKeyAttributeType) (ret ImportKeyPayloadGetWrappedKeyRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setImportKeyPayloadGetWrappedKeyAttributeType(arg *ImportKeyPayloadGetWrappedKeyAttributeType, val ImportKeyPayloadGetWrappedKeyRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type ImportKeyPayloadGetWrappedKeyArgType = string
|
||||
type ImportKeyPayloadGetWrappedKeyRetType = string
|
||||
|
||||
/*
|
||||
types and functions for wrappingKeyId
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type ImportKeyPayloadGetWrappingKeyIdAttributeType = *string
|
||||
|
||||
func getImportKeyPayloadGetWrappingKeyIdAttributeTypeOk(arg ImportKeyPayloadGetWrappingKeyIdAttributeType) (ret ImportKeyPayloadGetWrappingKeyIdRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setImportKeyPayloadGetWrappingKeyIdAttributeType(arg *ImportKeyPayloadGetWrappingKeyIdAttributeType, val ImportKeyPayloadGetWrappingKeyIdRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type ImportKeyPayloadGetWrappingKeyIdArgType = string
|
||||
type ImportKeyPayloadGetWrappingKeyIdRetType = string
|
||||
|
||||
// ImportKeyPayload struct for ImportKeyPayload
|
||||
type ImportKeyPayload struct {
|
||||
// The wrapped key material that has to be imported. Encoded in base64.
|
||||
// REQUIRED
|
||||
WrappedKey ImportKeyPayloadGetWrappedKeyAttributeType `json:"wrappedKey" required:"true"`
|
||||
// The unique id of the wrapping key the key material has been wrapped with.
|
||||
// REQUIRED
|
||||
WrappingKeyId ImportKeyPayloadGetWrappingKeyIdAttributeType `json:"wrappingKeyId" required:"true"`
|
||||
}
|
||||
|
||||
type _ImportKeyPayload ImportKeyPayload
|
||||
|
||||
// NewImportKeyPayload instantiates a new ImportKeyPayload 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 NewImportKeyPayload(wrappedKey ImportKeyPayloadGetWrappedKeyArgType, wrappingKeyId ImportKeyPayloadGetWrappingKeyIdArgType) *ImportKeyPayload {
|
||||
this := ImportKeyPayload{}
|
||||
setImportKeyPayloadGetWrappedKeyAttributeType(&this.WrappedKey, wrappedKey)
|
||||
setImportKeyPayloadGetWrappingKeyIdAttributeType(&this.WrappingKeyId, wrappingKeyId)
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewImportKeyPayloadWithDefaults instantiates a new ImportKeyPayload 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 NewImportKeyPayloadWithDefaults() *ImportKeyPayload {
|
||||
this := ImportKeyPayload{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetWrappedKey returns the WrappedKey field value
|
||||
func (o *ImportKeyPayload) GetWrappedKey() (ret ImportKeyPayloadGetWrappedKeyRetType) {
|
||||
ret, _ = o.GetWrappedKeyOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetWrappedKeyOk returns a tuple with the WrappedKey field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *ImportKeyPayload) GetWrappedKeyOk() (ret ImportKeyPayloadGetWrappedKeyRetType, ok bool) {
|
||||
return getImportKeyPayloadGetWrappedKeyAttributeTypeOk(o.WrappedKey)
|
||||
}
|
||||
|
||||
// SetWrappedKey sets field value
|
||||
func (o *ImportKeyPayload) SetWrappedKey(v ImportKeyPayloadGetWrappedKeyRetType) {
|
||||
setImportKeyPayloadGetWrappedKeyAttributeType(&o.WrappedKey, v)
|
||||
}
|
||||
|
||||
// GetWrappingKeyId returns the WrappingKeyId field value
|
||||
func (o *ImportKeyPayload) GetWrappingKeyId() (ret ImportKeyPayloadGetWrappingKeyIdRetType) {
|
||||
ret, _ = o.GetWrappingKeyIdOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetWrappingKeyIdOk returns a tuple with the WrappingKeyId field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *ImportKeyPayload) GetWrappingKeyIdOk() (ret ImportKeyPayloadGetWrappingKeyIdRetType, ok bool) {
|
||||
return getImportKeyPayloadGetWrappingKeyIdAttributeTypeOk(o.WrappingKeyId)
|
||||
}
|
||||
|
||||
// SetWrappingKeyId sets field value
|
||||
func (o *ImportKeyPayload) SetWrappingKeyId(v ImportKeyPayloadGetWrappingKeyIdRetType) {
|
||||
setImportKeyPayloadGetWrappingKeyIdAttributeType(&o.WrappingKeyId, v)
|
||||
}
|
||||
|
||||
func (o ImportKeyPayload) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getImportKeyPayloadGetWrappedKeyAttributeTypeOk(o.WrappedKey); ok {
|
||||
toSerialize["WrappedKey"] = val
|
||||
}
|
||||
if val, ok := getImportKeyPayloadGetWrappingKeyIdAttributeTypeOk(o.WrappingKeyId); ok {
|
||||
toSerialize["WrappingKeyId"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableImportKeyPayload struct {
|
||||
value *ImportKeyPayload
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableImportKeyPayload) Get() *ImportKeyPayload {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableImportKeyPayload) Set(val *ImportKeyPayload) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableImportKeyPayload) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableImportKeyPayload) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableImportKeyPayload(val *ImportKeyPayload) *NullableImportKeyPayload {
|
||||
return &NullableImportKeyPayload{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableImportKeyPayload) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableImportKeyPayload) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
11
pkg/kmsbeta/model_import_key_payload_test.go
Normal file
11
pkg/kmsbeta/model_import_key_payload_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
779
pkg/kmsbeta/model_key.go
Normal file
779
pkg/kmsbeta/model_key.go
Normal file
|
|
@ -0,0 +1,779 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"time"
|
||||
)
|
||||
|
||||
// checks if the Key type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &Key{}
|
||||
|
||||
/*
|
||||
types and functions for access_scope
|
||||
*/
|
||||
|
||||
// isEnumRef
|
||||
type KeyGetAccessScopeAttributeType = *AccessScope
|
||||
type KeyGetAccessScopeArgType = AccessScope
|
||||
type KeyGetAccessScopeRetType = AccessScope
|
||||
|
||||
func getKeyGetAccessScopeAttributeTypeOk(arg KeyGetAccessScopeAttributeType) (ret KeyGetAccessScopeRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setKeyGetAccessScopeAttributeType(arg *KeyGetAccessScopeAttributeType, val KeyGetAccessScopeRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for algorithm
|
||||
*/
|
||||
|
||||
// isEnumRef
|
||||
type KeyGetAlgorithmAttributeType = *Algorithm
|
||||
type KeyGetAlgorithmArgType = Algorithm
|
||||
type KeyGetAlgorithmRetType = Algorithm
|
||||
|
||||
func getKeyGetAlgorithmAttributeTypeOk(arg KeyGetAlgorithmAttributeType) (ret KeyGetAlgorithmRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setKeyGetAlgorithmAttributeType(arg *KeyGetAlgorithmAttributeType, val KeyGetAlgorithmRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for backend
|
||||
*/
|
||||
|
||||
// isEnumRef
|
||||
type KeyGetBackendAttributeType = *Backend
|
||||
type KeyGetBackendArgType = Backend
|
||||
type KeyGetBackendRetType = Backend
|
||||
|
||||
func getKeyGetBackendAttributeTypeOk(arg KeyGetBackendAttributeType) (ret KeyGetBackendRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setKeyGetBackendAttributeType(arg *KeyGetBackendAttributeType, val KeyGetBackendRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for createdAt
|
||||
*/
|
||||
|
||||
// isDateTime
|
||||
type KeyGetCreatedAtAttributeType = *time.Time
|
||||
type KeyGetCreatedAtArgType = time.Time
|
||||
type KeyGetCreatedAtRetType = time.Time
|
||||
|
||||
func getKeyGetCreatedAtAttributeTypeOk(arg KeyGetCreatedAtAttributeType) (ret KeyGetCreatedAtRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setKeyGetCreatedAtAttributeType(arg *KeyGetCreatedAtAttributeType, val KeyGetCreatedAtRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for deletionDate
|
||||
*/
|
||||
|
||||
// isDateTime
|
||||
type KeyGetDeletionDateAttributeType = *time.Time
|
||||
type KeyGetDeletionDateArgType = time.Time
|
||||
type KeyGetDeletionDateRetType = time.Time
|
||||
|
||||
func getKeyGetDeletionDateAttributeTypeOk(arg KeyGetDeletionDateAttributeType) (ret KeyGetDeletionDateRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setKeyGetDeletionDateAttributeType(arg *KeyGetDeletionDateAttributeType, val KeyGetDeletionDateRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for description
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type KeyGetDescriptionAttributeType = *string
|
||||
|
||||
func getKeyGetDescriptionAttributeTypeOk(arg KeyGetDescriptionAttributeType) (ret KeyGetDescriptionRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setKeyGetDescriptionAttributeType(arg *KeyGetDescriptionAttributeType, val KeyGetDescriptionRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type KeyGetDescriptionArgType = string
|
||||
type KeyGetDescriptionRetType = string
|
||||
|
||||
/*
|
||||
types and functions for displayName
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type KeyGetDisplayNameAttributeType = *string
|
||||
|
||||
func getKeyGetDisplayNameAttributeTypeOk(arg KeyGetDisplayNameAttributeType) (ret KeyGetDisplayNameRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setKeyGetDisplayNameAttributeType(arg *KeyGetDisplayNameAttributeType, val KeyGetDisplayNameRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type KeyGetDisplayNameArgType = string
|
||||
type KeyGetDisplayNameRetType = string
|
||||
|
||||
/*
|
||||
types and functions for id
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type KeyGetIdAttributeType = *string
|
||||
|
||||
func getKeyGetIdAttributeTypeOk(arg KeyGetIdAttributeType) (ret KeyGetIdRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setKeyGetIdAttributeType(arg *KeyGetIdAttributeType, val KeyGetIdRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type KeyGetIdArgType = string
|
||||
type KeyGetIdRetType = string
|
||||
|
||||
/*
|
||||
types and functions for importOnly
|
||||
*/
|
||||
|
||||
// isBoolean
|
||||
type KeygetImportOnlyAttributeType = *bool
|
||||
type KeygetImportOnlyArgType = bool
|
||||
type KeygetImportOnlyRetType = bool
|
||||
|
||||
func getKeygetImportOnlyAttributeTypeOk(arg KeygetImportOnlyAttributeType) (ret KeygetImportOnlyRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setKeygetImportOnlyAttributeType(arg *KeygetImportOnlyAttributeType, val KeygetImportOnlyRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for keyRingId
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type KeyGetKeyRingIdAttributeType = *string
|
||||
|
||||
func getKeyGetKeyRingIdAttributeTypeOk(arg KeyGetKeyRingIdAttributeType) (ret KeyGetKeyRingIdRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setKeyGetKeyRingIdAttributeType(arg *KeyGetKeyRingIdAttributeType, val KeyGetKeyRingIdRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type KeyGetKeyRingIdArgType = string
|
||||
type KeyGetKeyRingIdRetType = string
|
||||
|
||||
/*
|
||||
types and functions for protection
|
||||
*/
|
||||
|
||||
// isEnumRef
|
||||
type KeyGetProtectionAttributeType = *Protection
|
||||
type KeyGetProtectionArgType = Protection
|
||||
type KeyGetProtectionRetType = Protection
|
||||
|
||||
func getKeyGetProtectionAttributeTypeOk(arg KeyGetProtectionAttributeType) (ret KeyGetProtectionRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setKeyGetProtectionAttributeType(arg *KeyGetProtectionAttributeType, val KeyGetProtectionRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for purpose
|
||||
*/
|
||||
|
||||
// isEnumRef
|
||||
type KeyGetPurposeAttributeType = *Purpose
|
||||
type KeyGetPurposeArgType = Purpose
|
||||
type KeyGetPurposeRetType = Purpose
|
||||
|
||||
func getKeyGetPurposeAttributeTypeOk(arg KeyGetPurposeAttributeType) (ret KeyGetPurposeRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setKeyGetPurposeAttributeType(arg *KeyGetPurposeAttributeType, val KeyGetPurposeRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for state
|
||||
*/
|
||||
|
||||
// isEnum
|
||||
|
||||
// KeyState The current state of the key.
|
||||
// value type for enums
|
||||
type KeyState string
|
||||
|
||||
// List of State
|
||||
const (
|
||||
KEYSTATE_ACTIVE KeyState = "active"
|
||||
KEYSTATE_DELETED KeyState = "deleted"
|
||||
KEYSTATE_NOT_AVAILABLE KeyState = "not_available"
|
||||
KEYSTATE_ERRORS_EXIST KeyState = "errors_exist"
|
||||
KEYSTATE_CREATING KeyState = "creating"
|
||||
KEYSTATE_NO_VERSION KeyState = "no_version"
|
||||
)
|
||||
|
||||
// All allowed values of Key enum
|
||||
var AllowedKeyStateEnumValues = []KeyState{
|
||||
"active",
|
||||
"deleted",
|
||||
"not_available",
|
||||
"errors_exist",
|
||||
"creating",
|
||||
"no_version",
|
||||
}
|
||||
|
||||
func (v *KeyState) 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 KeyState
|
||||
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 := KeyState(value)
|
||||
for _, existing := range AllowedKeyStateEnumValues {
|
||||
if existing == enumTypeValue {
|
||||
*v = enumTypeValue
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
return fmt.Errorf("%+v is not a valid Key", value)
|
||||
}
|
||||
|
||||
// NewKeyStateFromValue returns a pointer to a valid KeyState
|
||||
// for the value passed as argument, or an error if the value passed is not allowed by the enum
|
||||
func NewKeyStateFromValue(v KeyState) (*KeyState, error) {
|
||||
ev := KeyState(v)
|
||||
if ev.IsValid() {
|
||||
return &ev, nil
|
||||
} else {
|
||||
return nil, fmt.Errorf("invalid value '%v' for KeyState: valid values are %v", v, AllowedKeyStateEnumValues)
|
||||
}
|
||||
}
|
||||
|
||||
// IsValid return true if the value is valid for the enum, false otherwise
|
||||
func (v KeyState) IsValid() bool {
|
||||
for _, existing := range AllowedKeyStateEnumValues {
|
||||
if existing == v {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// Ptr returns reference to StateState value
|
||||
func (v KeyState) Ptr() *KeyState {
|
||||
return &v
|
||||
}
|
||||
|
||||
type NullableKeyState struct {
|
||||
value *KeyState
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableKeyState) Get() *KeyState {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableKeyState) Set(val *KeyState) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableKeyState) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableKeyState) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableKeyState(val *KeyState) *NullableKeyState {
|
||||
return &NullableKeyState{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableKeyState) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableKeyState) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
type KeyGetStateAttributeType = *KeyState
|
||||
type KeyGetStateArgType = KeyState
|
||||
type KeyGetStateRetType = KeyState
|
||||
|
||||
func getKeyGetStateAttributeTypeOk(arg KeyGetStateAttributeType) (ret KeyGetStateRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setKeyGetStateAttributeType(arg *KeyGetStateAttributeType, val KeyGetStateRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
// Key struct for Key
|
||||
type Key struct {
|
||||
// REQUIRED
|
||||
AccessScope KeyGetAccessScopeAttributeType `json:"access_scope" required:"true"`
|
||||
// REQUIRED
|
||||
Algorithm KeyGetAlgorithmAttributeType `json:"algorithm" required:"true"`
|
||||
// Deprecated: Check the GitHub changelog for alternatives
|
||||
// REQUIRED
|
||||
Backend KeyGetBackendAttributeType `json:"backend" required:"true"`
|
||||
// The date and time the creation of the key was triggered.
|
||||
// REQUIRED
|
||||
CreatedAt KeyGetCreatedAtAttributeType `json:"createdAt" required:"true"`
|
||||
// This date is set when a key is pending deletion and refers to the scheduled date of deletion
|
||||
DeletionDate KeyGetDeletionDateAttributeType `json:"deletionDate,omitempty"`
|
||||
// A user chosen description to distinguish multiple keys.
|
||||
// REQUIRED
|
||||
Description KeyGetDescriptionAttributeType `json:"description" required:"true"`
|
||||
// The display name to distinguish multiple keys.
|
||||
// REQUIRED
|
||||
DisplayName KeyGetDisplayNameAttributeType `json:"displayName" required:"true"`
|
||||
// A auto generated unique id which identifies the keys.
|
||||
// REQUIRED
|
||||
Id KeyGetIdAttributeType `json:"id" required:"true"`
|
||||
// States whether versions can be created or only imported.
|
||||
// REQUIRED
|
||||
ImportOnly KeygetImportOnlyAttributeType `json:"importOnly" required:"true"`
|
||||
// The unique id of the key ring this key is assigned to.
|
||||
// REQUIRED
|
||||
KeyRingId KeyGetKeyRingIdAttributeType `json:"keyRingId" required:"true"`
|
||||
// REQUIRED
|
||||
Protection KeyGetProtectionAttributeType `json:"protection" required:"true"`
|
||||
// REQUIRED
|
||||
Purpose KeyGetPurposeAttributeType `json:"purpose" required:"true"`
|
||||
// The current state of the key.
|
||||
// REQUIRED
|
||||
State KeyGetStateAttributeType `json:"state" required:"true"`
|
||||
}
|
||||
|
||||
type _Key Key
|
||||
|
||||
// NewKey instantiates a new Key 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 NewKey(accessScope KeyGetAccessScopeArgType, algorithm KeyGetAlgorithmArgType, backend KeyGetBackendArgType, createdAt KeyGetCreatedAtArgType, description KeyGetDescriptionArgType, displayName KeyGetDisplayNameArgType, id KeyGetIdArgType, importOnly KeygetImportOnlyArgType, keyRingId KeyGetKeyRingIdArgType, protection KeyGetProtectionArgType, purpose KeyGetPurposeArgType, state KeyGetStateArgType) *Key {
|
||||
this := Key{}
|
||||
setKeyGetAccessScopeAttributeType(&this.AccessScope, accessScope)
|
||||
setKeyGetAlgorithmAttributeType(&this.Algorithm, algorithm)
|
||||
setKeyGetBackendAttributeType(&this.Backend, backend)
|
||||
setKeyGetCreatedAtAttributeType(&this.CreatedAt, createdAt)
|
||||
setKeyGetDescriptionAttributeType(&this.Description, description)
|
||||
setKeyGetDisplayNameAttributeType(&this.DisplayName, displayName)
|
||||
setKeyGetIdAttributeType(&this.Id, id)
|
||||
setKeygetImportOnlyAttributeType(&this.ImportOnly, importOnly)
|
||||
setKeyGetKeyRingIdAttributeType(&this.KeyRingId, keyRingId)
|
||||
setKeyGetProtectionAttributeType(&this.Protection, protection)
|
||||
setKeyGetPurposeAttributeType(&this.Purpose, purpose)
|
||||
setKeyGetStateAttributeType(&this.State, state)
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewKeyWithDefaults instantiates a new Key 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 NewKeyWithDefaults() *Key {
|
||||
this := Key{}
|
||||
var accessScope AccessScope = ACCESSSCOPE_PUBLIC
|
||||
this.AccessScope = &accessScope
|
||||
var importOnly bool = false
|
||||
this.ImportOnly = &importOnly
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetAccessScope returns the AccessScope field value
|
||||
func (o *Key) GetAccessScope() (ret KeyGetAccessScopeRetType) {
|
||||
ret, _ = o.GetAccessScopeOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetAccessScopeOk returns a tuple with the AccessScope field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Key) GetAccessScopeOk() (ret KeyGetAccessScopeRetType, ok bool) {
|
||||
return getKeyGetAccessScopeAttributeTypeOk(o.AccessScope)
|
||||
}
|
||||
|
||||
// SetAccessScope sets field value
|
||||
func (o *Key) SetAccessScope(v KeyGetAccessScopeRetType) {
|
||||
setKeyGetAccessScopeAttributeType(&o.AccessScope, v)
|
||||
}
|
||||
|
||||
// GetAlgorithm returns the Algorithm field value
|
||||
func (o *Key) GetAlgorithm() (ret KeyGetAlgorithmRetType) {
|
||||
ret, _ = o.GetAlgorithmOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetAlgorithmOk returns a tuple with the Algorithm field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Key) GetAlgorithmOk() (ret KeyGetAlgorithmRetType, ok bool) {
|
||||
return getKeyGetAlgorithmAttributeTypeOk(o.Algorithm)
|
||||
}
|
||||
|
||||
// SetAlgorithm sets field value
|
||||
func (o *Key) SetAlgorithm(v KeyGetAlgorithmRetType) {
|
||||
setKeyGetAlgorithmAttributeType(&o.Algorithm, v)
|
||||
}
|
||||
|
||||
// GetBackend returns the Backend field value
|
||||
// Deprecated
|
||||
func (o *Key) GetBackend() (ret KeyGetBackendRetType) {
|
||||
ret, _ = o.GetBackendOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetBackendOk returns a tuple with the Backend field value
|
||||
// and a boolean to check if the value has been set.
|
||||
// Deprecated
|
||||
func (o *Key) GetBackendOk() (ret KeyGetBackendRetType, ok bool) {
|
||||
return getKeyGetBackendAttributeTypeOk(o.Backend)
|
||||
}
|
||||
|
||||
// SetBackend sets field value
|
||||
// Deprecated
|
||||
func (o *Key) SetBackend(v KeyGetBackendRetType) {
|
||||
setKeyGetBackendAttributeType(&o.Backend, v)
|
||||
}
|
||||
|
||||
// GetCreatedAt returns the CreatedAt field value
|
||||
func (o *Key) GetCreatedAt() (ret KeyGetCreatedAtRetType) {
|
||||
ret, _ = o.GetCreatedAtOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetCreatedAtOk returns a tuple with the CreatedAt field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Key) GetCreatedAtOk() (ret KeyGetCreatedAtRetType, ok bool) {
|
||||
return getKeyGetCreatedAtAttributeTypeOk(o.CreatedAt)
|
||||
}
|
||||
|
||||
// SetCreatedAt sets field value
|
||||
func (o *Key) SetCreatedAt(v KeyGetCreatedAtRetType) {
|
||||
setKeyGetCreatedAtAttributeType(&o.CreatedAt, v)
|
||||
}
|
||||
|
||||
// GetDeletionDate returns the DeletionDate field value if set, zero value otherwise.
|
||||
func (o *Key) GetDeletionDate() (res KeyGetDeletionDateRetType) {
|
||||
res, _ = o.GetDeletionDateOk()
|
||||
return
|
||||
}
|
||||
|
||||
// GetDeletionDateOk returns a tuple with the DeletionDate field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Key) GetDeletionDateOk() (ret KeyGetDeletionDateRetType, ok bool) {
|
||||
return getKeyGetDeletionDateAttributeTypeOk(o.DeletionDate)
|
||||
}
|
||||
|
||||
// HasDeletionDate returns a boolean if a field has been set.
|
||||
func (o *Key) HasDeletionDate() bool {
|
||||
_, ok := o.GetDeletionDateOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetDeletionDate gets a reference to the given time.Time and assigns it to the DeletionDate field.
|
||||
func (o *Key) SetDeletionDate(v KeyGetDeletionDateRetType) {
|
||||
setKeyGetDeletionDateAttributeType(&o.DeletionDate, v)
|
||||
}
|
||||
|
||||
// GetDescription returns the Description field value
|
||||
func (o *Key) GetDescription() (ret KeyGetDescriptionRetType) {
|
||||
ret, _ = o.GetDescriptionOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetDescriptionOk returns a tuple with the Description field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Key) GetDescriptionOk() (ret KeyGetDescriptionRetType, ok bool) {
|
||||
return getKeyGetDescriptionAttributeTypeOk(o.Description)
|
||||
}
|
||||
|
||||
// SetDescription sets field value
|
||||
func (o *Key) SetDescription(v KeyGetDescriptionRetType) {
|
||||
setKeyGetDescriptionAttributeType(&o.Description, v)
|
||||
}
|
||||
|
||||
// GetDisplayName returns the DisplayName field value
|
||||
func (o *Key) GetDisplayName() (ret KeyGetDisplayNameRetType) {
|
||||
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 *Key) GetDisplayNameOk() (ret KeyGetDisplayNameRetType, ok bool) {
|
||||
return getKeyGetDisplayNameAttributeTypeOk(o.DisplayName)
|
||||
}
|
||||
|
||||
// SetDisplayName sets field value
|
||||
func (o *Key) SetDisplayName(v KeyGetDisplayNameRetType) {
|
||||
setKeyGetDisplayNameAttributeType(&o.DisplayName, v)
|
||||
}
|
||||
|
||||
// GetId returns the Id field value
|
||||
func (o *Key) GetId() (ret KeyGetIdRetType) {
|
||||
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 *Key) GetIdOk() (ret KeyGetIdRetType, ok bool) {
|
||||
return getKeyGetIdAttributeTypeOk(o.Id)
|
||||
}
|
||||
|
||||
// SetId sets field value
|
||||
func (o *Key) SetId(v KeyGetIdRetType) {
|
||||
setKeyGetIdAttributeType(&o.Id, v)
|
||||
}
|
||||
|
||||
// GetImportOnly returns the ImportOnly field value
|
||||
func (o *Key) GetImportOnly() (ret KeygetImportOnlyRetType) {
|
||||
ret, _ = o.GetImportOnlyOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetImportOnlyOk returns a tuple with the ImportOnly field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Key) GetImportOnlyOk() (ret KeygetImportOnlyRetType, ok bool) {
|
||||
return getKeygetImportOnlyAttributeTypeOk(o.ImportOnly)
|
||||
}
|
||||
|
||||
// SetImportOnly sets field value
|
||||
func (o *Key) SetImportOnly(v KeygetImportOnlyRetType) {
|
||||
setKeygetImportOnlyAttributeType(&o.ImportOnly, v)
|
||||
}
|
||||
|
||||
// GetKeyRingId returns the KeyRingId field value
|
||||
func (o *Key) GetKeyRingId() (ret KeyGetKeyRingIdRetType) {
|
||||
ret, _ = o.GetKeyRingIdOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetKeyRingIdOk returns a tuple with the KeyRingId field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Key) GetKeyRingIdOk() (ret KeyGetKeyRingIdRetType, ok bool) {
|
||||
return getKeyGetKeyRingIdAttributeTypeOk(o.KeyRingId)
|
||||
}
|
||||
|
||||
// SetKeyRingId sets field value
|
||||
func (o *Key) SetKeyRingId(v KeyGetKeyRingIdRetType) {
|
||||
setKeyGetKeyRingIdAttributeType(&o.KeyRingId, v)
|
||||
}
|
||||
|
||||
// GetProtection returns the Protection field value
|
||||
func (o *Key) GetProtection() (ret KeyGetProtectionRetType) {
|
||||
ret, _ = o.GetProtectionOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetProtectionOk returns a tuple with the Protection field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Key) GetProtectionOk() (ret KeyGetProtectionRetType, ok bool) {
|
||||
return getKeyGetProtectionAttributeTypeOk(o.Protection)
|
||||
}
|
||||
|
||||
// SetProtection sets field value
|
||||
func (o *Key) SetProtection(v KeyGetProtectionRetType) {
|
||||
setKeyGetProtectionAttributeType(&o.Protection, v)
|
||||
}
|
||||
|
||||
// GetPurpose returns the Purpose field value
|
||||
func (o *Key) GetPurpose() (ret KeyGetPurposeRetType) {
|
||||
ret, _ = o.GetPurposeOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetPurposeOk returns a tuple with the Purpose field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Key) GetPurposeOk() (ret KeyGetPurposeRetType, ok bool) {
|
||||
return getKeyGetPurposeAttributeTypeOk(o.Purpose)
|
||||
}
|
||||
|
||||
// SetPurpose sets field value
|
||||
func (o *Key) SetPurpose(v KeyGetPurposeRetType) {
|
||||
setKeyGetPurposeAttributeType(&o.Purpose, v)
|
||||
}
|
||||
|
||||
// GetState returns the State field value
|
||||
func (o *Key) GetState() (ret KeyGetStateRetType) {
|
||||
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 *Key) GetStateOk() (ret KeyGetStateRetType, ok bool) {
|
||||
return getKeyGetStateAttributeTypeOk(o.State)
|
||||
}
|
||||
|
||||
// SetState sets field value
|
||||
func (o *Key) SetState(v KeyGetStateRetType) {
|
||||
setKeyGetStateAttributeType(&o.State, v)
|
||||
}
|
||||
|
||||
func (o Key) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getKeyGetAccessScopeAttributeTypeOk(o.AccessScope); ok {
|
||||
toSerialize["AccessScope"] = val
|
||||
}
|
||||
if val, ok := getKeyGetAlgorithmAttributeTypeOk(o.Algorithm); ok {
|
||||
toSerialize["Algorithm"] = val
|
||||
}
|
||||
if val, ok := getKeyGetBackendAttributeTypeOk(o.Backend); ok {
|
||||
toSerialize["Backend"] = val
|
||||
}
|
||||
if val, ok := getKeyGetCreatedAtAttributeTypeOk(o.CreatedAt); ok {
|
||||
toSerialize["CreatedAt"] = val
|
||||
}
|
||||
if val, ok := getKeyGetDeletionDateAttributeTypeOk(o.DeletionDate); ok {
|
||||
toSerialize["DeletionDate"] = val
|
||||
}
|
||||
if val, ok := getKeyGetDescriptionAttributeTypeOk(o.Description); ok {
|
||||
toSerialize["Description"] = val
|
||||
}
|
||||
if val, ok := getKeyGetDisplayNameAttributeTypeOk(o.DisplayName); ok {
|
||||
toSerialize["DisplayName"] = val
|
||||
}
|
||||
if val, ok := getKeyGetIdAttributeTypeOk(o.Id); ok {
|
||||
toSerialize["Id"] = val
|
||||
}
|
||||
if val, ok := getKeygetImportOnlyAttributeTypeOk(o.ImportOnly); ok {
|
||||
toSerialize["ImportOnly"] = val
|
||||
}
|
||||
if val, ok := getKeyGetKeyRingIdAttributeTypeOk(o.KeyRingId); ok {
|
||||
toSerialize["KeyRingId"] = val
|
||||
}
|
||||
if val, ok := getKeyGetProtectionAttributeTypeOk(o.Protection); ok {
|
||||
toSerialize["Protection"] = val
|
||||
}
|
||||
if val, ok := getKeyGetPurposeAttributeTypeOk(o.Purpose); ok {
|
||||
toSerialize["Purpose"] = val
|
||||
}
|
||||
if val, ok := getKeyGetStateAttributeTypeOk(o.State); ok {
|
||||
toSerialize["State"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableKey struct {
|
||||
value *Key
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableKey) Get() *Key {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableKey) Set(val *Key) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableKey) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableKey) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableKey(val *Key) *NullableKey {
|
||||
return &NullableKey{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableKey) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableKey) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
125
pkg/kmsbeta/model_key_list.go
Normal file
125
pkg/kmsbeta/model_key_list.go
Normal file
|
|
@ -0,0 +1,125 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the KeyList type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &KeyList{}
|
||||
|
||||
/*
|
||||
types and functions for keys
|
||||
*/
|
||||
|
||||
// isArray
|
||||
type KeyListGetKeysAttributeType = *[]Key
|
||||
type KeyListGetKeysArgType = []Key
|
||||
type KeyListGetKeysRetType = []Key
|
||||
|
||||
func getKeyListGetKeysAttributeTypeOk(arg KeyListGetKeysAttributeType) (ret KeyListGetKeysRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setKeyListGetKeysAttributeType(arg *KeyListGetKeysAttributeType, val KeyListGetKeysRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
// KeyList struct for KeyList
|
||||
type KeyList struct {
|
||||
// REQUIRED
|
||||
Keys KeyListGetKeysAttributeType `json:"keys" required:"true"`
|
||||
}
|
||||
|
||||
type _KeyList KeyList
|
||||
|
||||
// NewKeyList instantiates a new KeyList 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 NewKeyList(keys KeyListGetKeysArgType) *KeyList {
|
||||
this := KeyList{}
|
||||
setKeyListGetKeysAttributeType(&this.Keys, keys)
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewKeyListWithDefaults instantiates a new KeyList 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 NewKeyListWithDefaults() *KeyList {
|
||||
this := KeyList{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetKeys returns the Keys field value
|
||||
func (o *KeyList) GetKeys() (ret KeyListGetKeysRetType) {
|
||||
ret, _ = o.GetKeysOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetKeysOk returns a tuple with the Keys field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *KeyList) GetKeysOk() (ret KeyListGetKeysRetType, ok bool) {
|
||||
return getKeyListGetKeysAttributeTypeOk(o.Keys)
|
||||
}
|
||||
|
||||
// SetKeys sets field value
|
||||
func (o *KeyList) SetKeys(v KeyListGetKeysRetType) {
|
||||
setKeyListGetKeysAttributeType(&o.Keys, v)
|
||||
}
|
||||
|
||||
func (o KeyList) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getKeyListGetKeysAttributeTypeOk(o.Keys); ok {
|
||||
toSerialize["Keys"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableKeyList struct {
|
||||
value *KeyList
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableKeyList) Get() *KeyList {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableKeyList) Set(val *KeyList) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableKeyList) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableKeyList) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableKeyList(val *KeyList) *NullableKeyList {
|
||||
return &NullableKeyList{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableKeyList) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableKeyList) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
11
pkg/kmsbeta/model_key_list_test.go
Normal file
11
pkg/kmsbeta/model_key_list_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
413
pkg/kmsbeta/model_key_ring.go
Normal file
413
pkg/kmsbeta/model_key_ring.go
Normal file
|
|
@ -0,0 +1,413 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"time"
|
||||
)
|
||||
|
||||
// checks if the KeyRing type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &KeyRing{}
|
||||
|
||||
/*
|
||||
types and functions for createdAt
|
||||
*/
|
||||
|
||||
// isDateTime
|
||||
type KeyRingGetCreatedAtAttributeType = *time.Time
|
||||
type KeyRingGetCreatedAtArgType = time.Time
|
||||
type KeyRingGetCreatedAtRetType = time.Time
|
||||
|
||||
func getKeyRingGetCreatedAtAttributeTypeOk(arg KeyRingGetCreatedAtAttributeType) (ret KeyRingGetCreatedAtRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setKeyRingGetCreatedAtAttributeType(arg *KeyRingGetCreatedAtAttributeType, val KeyRingGetCreatedAtRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for description
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type KeyRingGetDescriptionAttributeType = *string
|
||||
|
||||
func getKeyRingGetDescriptionAttributeTypeOk(arg KeyRingGetDescriptionAttributeType) (ret KeyRingGetDescriptionRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setKeyRingGetDescriptionAttributeType(arg *KeyRingGetDescriptionAttributeType, val KeyRingGetDescriptionRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type KeyRingGetDescriptionArgType = string
|
||||
type KeyRingGetDescriptionRetType = string
|
||||
|
||||
/*
|
||||
types and functions for displayName
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type KeyRingGetDisplayNameAttributeType = *string
|
||||
|
||||
func getKeyRingGetDisplayNameAttributeTypeOk(arg KeyRingGetDisplayNameAttributeType) (ret KeyRingGetDisplayNameRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setKeyRingGetDisplayNameAttributeType(arg *KeyRingGetDisplayNameAttributeType, val KeyRingGetDisplayNameRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type KeyRingGetDisplayNameArgType = string
|
||||
type KeyRingGetDisplayNameRetType = string
|
||||
|
||||
/*
|
||||
types and functions for id
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type KeyRingGetIdAttributeType = *string
|
||||
|
||||
func getKeyRingGetIdAttributeTypeOk(arg KeyRingGetIdAttributeType) (ret KeyRingGetIdRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setKeyRingGetIdAttributeType(arg *KeyRingGetIdAttributeType, val KeyRingGetIdRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type KeyRingGetIdArgType = string
|
||||
type KeyRingGetIdRetType = string
|
||||
|
||||
/*
|
||||
types and functions for state
|
||||
*/
|
||||
|
||||
// isEnum
|
||||
|
||||
// KeyRingState The current state of the key ring.
|
||||
// value type for enums
|
||||
type KeyRingState string
|
||||
|
||||
// List of State
|
||||
const (
|
||||
KEYRINGSTATE_CREATING KeyRingState = "creating"
|
||||
KEYRINGSTATE_ACTIVE KeyRingState = "active"
|
||||
KEYRINGSTATE_DELETED KeyRingState = "deleted"
|
||||
)
|
||||
|
||||
// All allowed values of KeyRing enum
|
||||
var AllowedKeyRingStateEnumValues = []KeyRingState{
|
||||
"creating",
|
||||
"active",
|
||||
"deleted",
|
||||
}
|
||||
|
||||
func (v *KeyRingState) 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 KeyRingState
|
||||
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 := KeyRingState(value)
|
||||
for _, existing := range AllowedKeyRingStateEnumValues {
|
||||
if existing == enumTypeValue {
|
||||
*v = enumTypeValue
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
return fmt.Errorf("%+v is not a valid KeyRing", value)
|
||||
}
|
||||
|
||||
// NewKeyRingStateFromValue returns a pointer to a valid KeyRingState
|
||||
// for the value passed as argument, or an error if the value passed is not allowed by the enum
|
||||
func NewKeyRingStateFromValue(v KeyRingState) (*KeyRingState, error) {
|
||||
ev := KeyRingState(v)
|
||||
if ev.IsValid() {
|
||||
return &ev, nil
|
||||
} else {
|
||||
return nil, fmt.Errorf("invalid value '%v' for KeyRingState: valid values are %v", v, AllowedKeyRingStateEnumValues)
|
||||
}
|
||||
}
|
||||
|
||||
// IsValid return true if the value is valid for the enum, false otherwise
|
||||
func (v KeyRingState) IsValid() bool {
|
||||
for _, existing := range AllowedKeyRingStateEnumValues {
|
||||
if existing == v {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// Ptr returns reference to StateState value
|
||||
func (v KeyRingState) Ptr() *KeyRingState {
|
||||
return &v
|
||||
}
|
||||
|
||||
type NullableKeyRingState struct {
|
||||
value *KeyRingState
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableKeyRingState) Get() *KeyRingState {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableKeyRingState) Set(val *KeyRingState) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableKeyRingState) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableKeyRingState) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableKeyRingState(val *KeyRingState) *NullableKeyRingState {
|
||||
return &NullableKeyRingState{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableKeyRingState) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableKeyRingState) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
type KeyRingGetStateAttributeType = *KeyRingState
|
||||
type KeyRingGetStateArgType = KeyRingState
|
||||
type KeyRingGetStateRetType = KeyRingState
|
||||
|
||||
func getKeyRingGetStateAttributeTypeOk(arg KeyRingGetStateAttributeType) (ret KeyRingGetStateRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setKeyRingGetStateAttributeType(arg *KeyRingGetStateAttributeType, val KeyRingGetStateRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
// KeyRing struct for KeyRing
|
||||
type KeyRing struct {
|
||||
// The date and time the creation of the key ring was triggered.
|
||||
// REQUIRED
|
||||
CreatedAt KeyRingGetCreatedAtAttributeType `json:"createdAt" required:"true"`
|
||||
// A user chosen description to distinguish multiple key rings.
|
||||
// REQUIRED
|
||||
Description KeyRingGetDescriptionAttributeType `json:"description" required:"true"`
|
||||
// The display name to distinguish multiple key rings.
|
||||
// REQUIRED
|
||||
DisplayName KeyRingGetDisplayNameAttributeType `json:"displayName" required:"true"`
|
||||
// A auto generated unique id which identifies the key ring.
|
||||
// REQUIRED
|
||||
Id KeyRingGetIdAttributeType `json:"id" required:"true"`
|
||||
// The current state of the key ring.
|
||||
// REQUIRED
|
||||
State KeyRingGetStateAttributeType `json:"state" required:"true"`
|
||||
}
|
||||
|
||||
type _KeyRing KeyRing
|
||||
|
||||
// NewKeyRing instantiates a new KeyRing 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 NewKeyRing(createdAt KeyRingGetCreatedAtArgType, description KeyRingGetDescriptionArgType, displayName KeyRingGetDisplayNameArgType, id KeyRingGetIdArgType, state KeyRingGetStateArgType) *KeyRing {
|
||||
this := KeyRing{}
|
||||
setKeyRingGetCreatedAtAttributeType(&this.CreatedAt, createdAt)
|
||||
setKeyRingGetDescriptionAttributeType(&this.Description, description)
|
||||
setKeyRingGetDisplayNameAttributeType(&this.DisplayName, displayName)
|
||||
setKeyRingGetIdAttributeType(&this.Id, id)
|
||||
setKeyRingGetStateAttributeType(&this.State, state)
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewKeyRingWithDefaults instantiates a new KeyRing 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 NewKeyRingWithDefaults() *KeyRing {
|
||||
this := KeyRing{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetCreatedAt returns the CreatedAt field value
|
||||
func (o *KeyRing) GetCreatedAt() (ret KeyRingGetCreatedAtRetType) {
|
||||
ret, _ = o.GetCreatedAtOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetCreatedAtOk returns a tuple with the CreatedAt field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *KeyRing) GetCreatedAtOk() (ret KeyRingGetCreatedAtRetType, ok bool) {
|
||||
return getKeyRingGetCreatedAtAttributeTypeOk(o.CreatedAt)
|
||||
}
|
||||
|
||||
// SetCreatedAt sets field value
|
||||
func (o *KeyRing) SetCreatedAt(v KeyRingGetCreatedAtRetType) {
|
||||
setKeyRingGetCreatedAtAttributeType(&o.CreatedAt, v)
|
||||
}
|
||||
|
||||
// GetDescription returns the Description field value
|
||||
func (o *KeyRing) GetDescription() (ret KeyRingGetDescriptionRetType) {
|
||||
ret, _ = o.GetDescriptionOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetDescriptionOk returns a tuple with the Description field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *KeyRing) GetDescriptionOk() (ret KeyRingGetDescriptionRetType, ok bool) {
|
||||
return getKeyRingGetDescriptionAttributeTypeOk(o.Description)
|
||||
}
|
||||
|
||||
// SetDescription sets field value
|
||||
func (o *KeyRing) SetDescription(v KeyRingGetDescriptionRetType) {
|
||||
setKeyRingGetDescriptionAttributeType(&o.Description, v)
|
||||
}
|
||||
|
||||
// GetDisplayName returns the DisplayName field value
|
||||
func (o *KeyRing) GetDisplayName() (ret KeyRingGetDisplayNameRetType) {
|
||||
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 *KeyRing) GetDisplayNameOk() (ret KeyRingGetDisplayNameRetType, ok bool) {
|
||||
return getKeyRingGetDisplayNameAttributeTypeOk(o.DisplayName)
|
||||
}
|
||||
|
||||
// SetDisplayName sets field value
|
||||
func (o *KeyRing) SetDisplayName(v KeyRingGetDisplayNameRetType) {
|
||||
setKeyRingGetDisplayNameAttributeType(&o.DisplayName, v)
|
||||
}
|
||||
|
||||
// GetId returns the Id field value
|
||||
func (o *KeyRing) GetId() (ret KeyRingGetIdRetType) {
|
||||
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 *KeyRing) GetIdOk() (ret KeyRingGetIdRetType, ok bool) {
|
||||
return getKeyRingGetIdAttributeTypeOk(o.Id)
|
||||
}
|
||||
|
||||
// SetId sets field value
|
||||
func (o *KeyRing) SetId(v KeyRingGetIdRetType) {
|
||||
setKeyRingGetIdAttributeType(&o.Id, v)
|
||||
}
|
||||
|
||||
// GetState returns the State field value
|
||||
func (o *KeyRing) GetState() (ret KeyRingGetStateRetType) {
|
||||
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 *KeyRing) GetStateOk() (ret KeyRingGetStateRetType, ok bool) {
|
||||
return getKeyRingGetStateAttributeTypeOk(o.State)
|
||||
}
|
||||
|
||||
// SetState sets field value
|
||||
func (o *KeyRing) SetState(v KeyRingGetStateRetType) {
|
||||
setKeyRingGetStateAttributeType(&o.State, v)
|
||||
}
|
||||
|
||||
func (o KeyRing) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getKeyRingGetCreatedAtAttributeTypeOk(o.CreatedAt); ok {
|
||||
toSerialize["CreatedAt"] = val
|
||||
}
|
||||
if val, ok := getKeyRingGetDescriptionAttributeTypeOk(o.Description); ok {
|
||||
toSerialize["Description"] = val
|
||||
}
|
||||
if val, ok := getKeyRingGetDisplayNameAttributeTypeOk(o.DisplayName); ok {
|
||||
toSerialize["DisplayName"] = val
|
||||
}
|
||||
if val, ok := getKeyRingGetIdAttributeTypeOk(o.Id); ok {
|
||||
toSerialize["Id"] = val
|
||||
}
|
||||
if val, ok := getKeyRingGetStateAttributeTypeOk(o.State); ok {
|
||||
toSerialize["State"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableKeyRing struct {
|
||||
value *KeyRing
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableKeyRing) Get() *KeyRing {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableKeyRing) Set(val *KeyRing) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableKeyRing) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableKeyRing) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableKeyRing(val *KeyRing) *NullableKeyRing {
|
||||
return &NullableKeyRing{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableKeyRing) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableKeyRing) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
125
pkg/kmsbeta/model_key_ring_list.go
Normal file
125
pkg/kmsbeta/model_key_ring_list.go
Normal file
|
|
@ -0,0 +1,125 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the KeyRingList type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &KeyRingList{}
|
||||
|
||||
/*
|
||||
types and functions for keyRings
|
||||
*/
|
||||
|
||||
// isArray
|
||||
type KeyRingListGetKeyRingsAttributeType = *[]KeyRing
|
||||
type KeyRingListGetKeyRingsArgType = []KeyRing
|
||||
type KeyRingListGetKeyRingsRetType = []KeyRing
|
||||
|
||||
func getKeyRingListGetKeyRingsAttributeTypeOk(arg KeyRingListGetKeyRingsAttributeType) (ret KeyRingListGetKeyRingsRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setKeyRingListGetKeyRingsAttributeType(arg *KeyRingListGetKeyRingsAttributeType, val KeyRingListGetKeyRingsRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
// KeyRingList struct for KeyRingList
|
||||
type KeyRingList struct {
|
||||
// REQUIRED
|
||||
KeyRings KeyRingListGetKeyRingsAttributeType `json:"keyRings" required:"true"`
|
||||
}
|
||||
|
||||
type _KeyRingList KeyRingList
|
||||
|
||||
// NewKeyRingList instantiates a new KeyRingList 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 NewKeyRingList(keyRings KeyRingListGetKeyRingsArgType) *KeyRingList {
|
||||
this := KeyRingList{}
|
||||
setKeyRingListGetKeyRingsAttributeType(&this.KeyRings, keyRings)
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewKeyRingListWithDefaults instantiates a new KeyRingList 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 NewKeyRingListWithDefaults() *KeyRingList {
|
||||
this := KeyRingList{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetKeyRings returns the KeyRings field value
|
||||
func (o *KeyRingList) GetKeyRings() (ret KeyRingListGetKeyRingsRetType) {
|
||||
ret, _ = o.GetKeyRingsOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetKeyRingsOk returns a tuple with the KeyRings field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *KeyRingList) GetKeyRingsOk() (ret KeyRingListGetKeyRingsRetType, ok bool) {
|
||||
return getKeyRingListGetKeyRingsAttributeTypeOk(o.KeyRings)
|
||||
}
|
||||
|
||||
// SetKeyRings sets field value
|
||||
func (o *KeyRingList) SetKeyRings(v KeyRingListGetKeyRingsRetType) {
|
||||
setKeyRingListGetKeyRingsAttributeType(&o.KeyRings, v)
|
||||
}
|
||||
|
||||
func (o KeyRingList) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getKeyRingListGetKeyRingsAttributeTypeOk(o.KeyRings); ok {
|
||||
toSerialize["KeyRings"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableKeyRingList struct {
|
||||
value *KeyRingList
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableKeyRingList) Get() *KeyRingList {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableKeyRingList) Set(val *KeyRingList) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableKeyRingList) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableKeyRingList) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableKeyRingList(val *KeyRingList) *NullableKeyRingList {
|
||||
return &NullableKeyRingList{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableKeyRingList) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableKeyRingList) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
11
pkg/kmsbeta/model_key_ring_list_test.go
Normal file
11
pkg/kmsbeta/model_key_ring_list_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
65
pkg/kmsbeta/model_key_ring_test.go
Normal file
65
pkg/kmsbeta/model_key_ring_test.go
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
// isEnum
|
||||
|
||||
func TestKeyRingState_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(`"creating"`),
|
||||
},
|
||||
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(`"deleted"`),
|
||||
},
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: "fail",
|
||||
args: args{
|
||||
src: []byte("\"FOOBAR\""),
|
||||
},
|
||||
wantErr: true,
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
v := KeyRingState("")
|
||||
if err := v.UnmarshalJSON(tt.args.src); (err != nil) != tt.wantErr {
|
||||
t.Errorf("UnmarshalJSON() error = %v, wantErr %v", err, tt.wantErr)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
86
pkg/kmsbeta/model_key_test.go
Normal file
86
pkg/kmsbeta/model_key_test.go
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
// isEnum
|
||||
|
||||
func TestKeyState_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(`"active"`),
|
||||
},
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: `success - possible enum value no. 2`,
|
||||
args: args{
|
||||
src: []byte(`"deleted"`),
|
||||
},
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: `success - possible enum value no. 3`,
|
||||
args: args{
|
||||
src: []byte(`"not_available"`),
|
||||
},
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: `success - possible enum value no. 4`,
|
||||
args: args{
|
||||
src: []byte(`"errors_exist"`),
|
||||
},
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: `success - possible enum value no. 5`,
|
||||
args: args{
|
||||
src: []byte(`"creating"`),
|
||||
},
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: `success - possible enum value no. 6`,
|
||||
args: args{
|
||||
src: []byte(`"no_version"`),
|
||||
},
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: "fail",
|
||||
args: args{
|
||||
src: []byte("\"FOOBAR\""),
|
||||
},
|
||||
wantErr: true,
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
v := KeyState("")
|
||||
if err := v.UnmarshalJSON(tt.args.src); (err != nil) != tt.wantErr {
|
||||
t.Errorf("UnmarshalJSON() error = %v, wantErr %v", err, tt.wantErr)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
113
pkg/kmsbeta/model_protection.go
Normal file
113
pkg/kmsbeta/model_protection.go
Normal file
|
|
@ -0,0 +1,113 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// Protection The underlying system that is responsible for protecting the key material. Overrides the deprecated 'backend' field.
|
||||
type Protection string
|
||||
|
||||
// List of protection
|
||||
const (
|
||||
PROTECTION_SOFTWARE Protection = "software"
|
||||
)
|
||||
|
||||
// All allowed values of Protection enum
|
||||
var AllowedProtectionEnumValues = []Protection{
|
||||
"software",
|
||||
}
|
||||
|
||||
func (v *Protection) 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 := Protection(value)
|
||||
for _, existing := range AllowedProtectionEnumValues {
|
||||
if existing == enumTypeValue {
|
||||
*v = enumTypeValue
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
return fmt.Errorf("%+v is not a valid Protection", value)
|
||||
}
|
||||
|
||||
// NewProtectionFromValue returns a pointer to a valid Protection
|
||||
// for the value passed as argument, or an error if the value passed is not allowed by the enum
|
||||
func NewProtectionFromValue(v string) (*Protection, error) {
|
||||
ev := Protection(v)
|
||||
if ev.IsValid() {
|
||||
return &ev, nil
|
||||
} else {
|
||||
return nil, fmt.Errorf("invalid value '%v' for Protection: valid values are %v", v, AllowedProtectionEnumValues)
|
||||
}
|
||||
}
|
||||
|
||||
// IsValid return true if the value is valid for the enum, false otherwise
|
||||
func (v Protection) IsValid() bool {
|
||||
for _, existing := range AllowedProtectionEnumValues {
|
||||
if existing == v {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// Ptr returns reference to protection value
|
||||
func (v Protection) Ptr() *Protection {
|
||||
return &v
|
||||
}
|
||||
|
||||
type NullableProtection struct {
|
||||
value *Protection
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableProtection) Get() *Protection {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableProtection) Set(val *Protection) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableProtection) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableProtection) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableProtection(val *Protection) *NullableProtection {
|
||||
return &NullableProtection{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableProtection) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableProtection) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
11
pkg/kmsbeta/model_protection_test.go
Normal file
11
pkg/kmsbeta/model_protection_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
119
pkg/kmsbeta/model_purpose.go
Normal file
119
pkg/kmsbeta/model_purpose.go
Normal file
|
|
@ -0,0 +1,119 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// Purpose The purpose of the key.
|
||||
type Purpose string
|
||||
|
||||
// List of purpose
|
||||
const (
|
||||
PURPOSE_SYMMETRIC_ENCRYPT_DECRYPT Purpose = "symmetric_encrypt_decrypt"
|
||||
PURPOSE_ASYMMETRIC_ENCRYPT_DECRYPT Purpose = "asymmetric_encrypt_decrypt"
|
||||
PURPOSE_MESSAGE_AUTHENTICATION_CODE Purpose = "message_authentication_code"
|
||||
PURPOSE_ASYMMETRIC_SIGN_VERIFY Purpose = "asymmetric_sign_verify"
|
||||
)
|
||||
|
||||
// All allowed values of Purpose enum
|
||||
var AllowedPurposeEnumValues = []Purpose{
|
||||
"symmetric_encrypt_decrypt",
|
||||
"asymmetric_encrypt_decrypt",
|
||||
"message_authentication_code",
|
||||
"asymmetric_sign_verify",
|
||||
}
|
||||
|
||||
func (v *Purpose) 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 := Purpose(value)
|
||||
for _, existing := range AllowedPurposeEnumValues {
|
||||
if existing == enumTypeValue {
|
||||
*v = enumTypeValue
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
return fmt.Errorf("%+v is not a valid Purpose", value)
|
||||
}
|
||||
|
||||
// NewPurposeFromValue returns a pointer to a valid Purpose
|
||||
// for the value passed as argument, or an error if the value passed is not allowed by the enum
|
||||
func NewPurposeFromValue(v string) (*Purpose, error) {
|
||||
ev := Purpose(v)
|
||||
if ev.IsValid() {
|
||||
return &ev, nil
|
||||
} else {
|
||||
return nil, fmt.Errorf("invalid value '%v' for Purpose: valid values are %v", v, AllowedPurposeEnumValues)
|
||||
}
|
||||
}
|
||||
|
||||
// IsValid return true if the value is valid for the enum, false otherwise
|
||||
func (v Purpose) IsValid() bool {
|
||||
for _, existing := range AllowedPurposeEnumValues {
|
||||
if existing == v {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// Ptr returns reference to purpose value
|
||||
func (v Purpose) Ptr() *Purpose {
|
||||
return &v
|
||||
}
|
||||
|
||||
type NullablePurpose struct {
|
||||
value *Purpose
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullablePurpose) Get() *Purpose {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullablePurpose) Set(val *Purpose) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullablePurpose) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullablePurpose) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullablePurpose(val *Purpose) *NullablePurpose {
|
||||
return &NullablePurpose{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullablePurpose) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullablePurpose) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
11
pkg/kmsbeta/model_purpose_test.go
Normal file
11
pkg/kmsbeta/model_purpose_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
126
pkg/kmsbeta/model_sign_payload.go
Normal file
126
pkg/kmsbeta/model_sign_payload.go
Normal file
|
|
@ -0,0 +1,126 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the SignPayload type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &SignPayload{}
|
||||
|
||||
/*
|
||||
types and functions for data
|
||||
*/
|
||||
|
||||
// isByteArray
|
||||
type SignPayloadGetDataAttributeType = *[]byte
|
||||
type SignPayloadGetDataArgType = []byte
|
||||
type SignPayloadGetDataRetType = []byte
|
||||
|
||||
func getSignPayloadGetDataAttributeTypeOk(arg SignPayloadGetDataAttributeType) (ret SignPayloadGetDataRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setSignPayloadGetDataAttributeType(arg *SignPayloadGetDataAttributeType, val SignPayloadGetDataRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
// SignPayload struct for SignPayload
|
||||
type SignPayload struct {
|
||||
// The data that has to be signed. Encoded in base64.
|
||||
// REQUIRED
|
||||
Data SignPayloadGetDataAttributeType `json:"data" required:"true"`
|
||||
}
|
||||
|
||||
type _SignPayload SignPayload
|
||||
|
||||
// NewSignPayload instantiates a new SignPayload 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 NewSignPayload(data SignPayloadGetDataArgType) *SignPayload {
|
||||
this := SignPayload{}
|
||||
setSignPayloadGetDataAttributeType(&this.Data, data)
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewSignPayloadWithDefaults instantiates a new SignPayload 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 NewSignPayloadWithDefaults() *SignPayload {
|
||||
this := SignPayload{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetData returns the Data field value
|
||||
func (o *SignPayload) GetData() (ret SignPayloadGetDataRetType) {
|
||||
ret, _ = o.GetDataOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetDataOk returns a tuple with the Data field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *SignPayload) GetDataOk() (ret SignPayloadGetDataRetType, ok bool) {
|
||||
return getSignPayloadGetDataAttributeTypeOk(o.Data)
|
||||
}
|
||||
|
||||
// SetData sets field value
|
||||
func (o *SignPayload) SetData(v SignPayloadGetDataRetType) {
|
||||
setSignPayloadGetDataAttributeType(&o.Data, v)
|
||||
}
|
||||
|
||||
func (o SignPayload) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getSignPayloadGetDataAttributeTypeOk(o.Data); ok {
|
||||
toSerialize["Data"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableSignPayload struct {
|
||||
value *SignPayload
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableSignPayload) Get() *SignPayload {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableSignPayload) Set(val *SignPayload) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableSignPayload) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableSignPayload) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableSignPayload(val *SignPayload) *NullableSignPayload {
|
||||
return &NullableSignPayload{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableSignPayload) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableSignPayload) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
11
pkg/kmsbeta/model_sign_payload_test.go
Normal file
11
pkg/kmsbeta/model_sign_payload_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
170
pkg/kmsbeta/model_signed_data.go
Normal file
170
pkg/kmsbeta/model_signed_data.go
Normal file
|
|
@ -0,0 +1,170 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the SignedData type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &SignedData{}
|
||||
|
||||
/*
|
||||
types and functions for data
|
||||
*/
|
||||
|
||||
// isByteArray
|
||||
type SignedDataGetDataAttributeType = *[]byte
|
||||
type SignedDataGetDataArgType = []byte
|
||||
type SignedDataGetDataRetType = []byte
|
||||
|
||||
func getSignedDataGetDataAttributeTypeOk(arg SignedDataGetDataAttributeType) (ret SignedDataGetDataRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setSignedDataGetDataAttributeType(arg *SignedDataGetDataAttributeType, val SignedDataGetDataRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for signature
|
||||
*/
|
||||
|
||||
// isByteArray
|
||||
type SignedDataGetSignatureAttributeType = *[]byte
|
||||
type SignedDataGetSignatureArgType = []byte
|
||||
type SignedDataGetSignatureRetType = []byte
|
||||
|
||||
func getSignedDataGetSignatureAttributeTypeOk(arg SignedDataGetSignatureAttributeType) (ret SignedDataGetSignatureRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setSignedDataGetSignatureAttributeType(arg *SignedDataGetSignatureAttributeType, val SignedDataGetSignatureRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
// SignedData struct for SignedData
|
||||
type SignedData struct {
|
||||
// The data that was signed. Encoded in base64.
|
||||
// REQUIRED
|
||||
Data SignedDataGetDataAttributeType `json:"data" required:"true"`
|
||||
// The signature of the data. Encoded in base64.
|
||||
// REQUIRED
|
||||
Signature SignedDataGetSignatureAttributeType `json:"signature" required:"true"`
|
||||
}
|
||||
|
||||
type _SignedData SignedData
|
||||
|
||||
// NewSignedData instantiates a new SignedData 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 NewSignedData(data SignedDataGetDataArgType, signature SignedDataGetSignatureArgType) *SignedData {
|
||||
this := SignedData{}
|
||||
setSignedDataGetDataAttributeType(&this.Data, data)
|
||||
setSignedDataGetSignatureAttributeType(&this.Signature, signature)
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewSignedDataWithDefaults instantiates a new SignedData 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 NewSignedDataWithDefaults() *SignedData {
|
||||
this := SignedData{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetData returns the Data field value
|
||||
func (o *SignedData) GetData() (ret SignedDataGetDataRetType) {
|
||||
ret, _ = o.GetDataOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetDataOk returns a tuple with the Data field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *SignedData) GetDataOk() (ret SignedDataGetDataRetType, ok bool) {
|
||||
return getSignedDataGetDataAttributeTypeOk(o.Data)
|
||||
}
|
||||
|
||||
// SetData sets field value
|
||||
func (o *SignedData) SetData(v SignedDataGetDataRetType) {
|
||||
setSignedDataGetDataAttributeType(&o.Data, v)
|
||||
}
|
||||
|
||||
// GetSignature returns the Signature field value
|
||||
func (o *SignedData) GetSignature() (ret SignedDataGetSignatureRetType) {
|
||||
ret, _ = o.GetSignatureOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetSignatureOk returns a tuple with the Signature field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *SignedData) GetSignatureOk() (ret SignedDataGetSignatureRetType, ok bool) {
|
||||
return getSignedDataGetSignatureAttributeTypeOk(o.Signature)
|
||||
}
|
||||
|
||||
// SetSignature sets field value
|
||||
func (o *SignedData) SetSignature(v SignedDataGetSignatureRetType) {
|
||||
setSignedDataGetSignatureAttributeType(&o.Signature, v)
|
||||
}
|
||||
|
||||
func (o SignedData) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getSignedDataGetDataAttributeTypeOk(o.Data); ok {
|
||||
toSerialize["Data"] = val
|
||||
}
|
||||
if val, ok := getSignedDataGetSignatureAttributeTypeOk(o.Signature); ok {
|
||||
toSerialize["Signature"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableSignedData struct {
|
||||
value *SignedData
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableSignedData) Get() *SignedData {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableSignedData) Set(val *SignedData) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableSignedData) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableSignedData) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableSignedData(val *SignedData) *NullableSignedData {
|
||||
return &NullableSignedData{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableSignedData) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableSignedData) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
11
pkg/kmsbeta/model_signed_data_test.go
Normal file
11
pkg/kmsbeta/model_signed_data_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
126
pkg/kmsbeta/model_verified_data.go
Normal file
126
pkg/kmsbeta/model_verified_data.go
Normal file
|
|
@ -0,0 +1,126 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the VerifiedData type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &VerifiedData{}
|
||||
|
||||
/*
|
||||
types and functions for valid
|
||||
*/
|
||||
|
||||
// isBoolean
|
||||
type VerifiedDatagetValidAttributeType = *bool
|
||||
type VerifiedDatagetValidArgType = bool
|
||||
type VerifiedDatagetValidRetType = bool
|
||||
|
||||
func getVerifiedDatagetValidAttributeTypeOk(arg VerifiedDatagetValidAttributeType) (ret VerifiedDatagetValidRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setVerifiedDatagetValidAttributeType(arg *VerifiedDatagetValidAttributeType, val VerifiedDatagetValidRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
// VerifiedData struct for VerifiedData
|
||||
type VerifiedData struct {
|
||||
// Whether or not the data has a valid signature.
|
||||
// REQUIRED
|
||||
Valid VerifiedDatagetValidAttributeType `json:"valid" required:"true"`
|
||||
}
|
||||
|
||||
type _VerifiedData VerifiedData
|
||||
|
||||
// NewVerifiedData instantiates a new VerifiedData 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 NewVerifiedData(valid VerifiedDatagetValidArgType) *VerifiedData {
|
||||
this := VerifiedData{}
|
||||
setVerifiedDatagetValidAttributeType(&this.Valid, valid)
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewVerifiedDataWithDefaults instantiates a new VerifiedData 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 NewVerifiedDataWithDefaults() *VerifiedData {
|
||||
this := VerifiedData{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetValid returns the Valid field value
|
||||
func (o *VerifiedData) GetValid() (ret VerifiedDatagetValidRetType) {
|
||||
ret, _ = o.GetValidOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetValidOk returns a tuple with the Valid field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *VerifiedData) GetValidOk() (ret VerifiedDatagetValidRetType, ok bool) {
|
||||
return getVerifiedDatagetValidAttributeTypeOk(o.Valid)
|
||||
}
|
||||
|
||||
// SetValid sets field value
|
||||
func (o *VerifiedData) SetValid(v VerifiedDatagetValidRetType) {
|
||||
setVerifiedDatagetValidAttributeType(&o.Valid, v)
|
||||
}
|
||||
|
||||
func (o VerifiedData) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getVerifiedDatagetValidAttributeTypeOk(o.Valid); ok {
|
||||
toSerialize["Valid"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableVerifiedData struct {
|
||||
value *VerifiedData
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableVerifiedData) Get() *VerifiedData {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableVerifiedData) Set(val *VerifiedData) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableVerifiedData) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableVerifiedData) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableVerifiedData(val *VerifiedData) *NullableVerifiedData {
|
||||
return &NullableVerifiedData{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableVerifiedData) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableVerifiedData) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
11
pkg/kmsbeta/model_verified_data_test.go
Normal file
11
pkg/kmsbeta/model_verified_data_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
170
pkg/kmsbeta/model_verify_payload.go
Normal file
170
pkg/kmsbeta/model_verify_payload.go
Normal file
|
|
@ -0,0 +1,170 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the VerifyPayload type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &VerifyPayload{}
|
||||
|
||||
/*
|
||||
types and functions for data
|
||||
*/
|
||||
|
||||
// isByteArray
|
||||
type VerifyPayloadGetDataAttributeType = *[]byte
|
||||
type VerifyPayloadGetDataArgType = []byte
|
||||
type VerifyPayloadGetDataRetType = []byte
|
||||
|
||||
func getVerifyPayloadGetDataAttributeTypeOk(arg VerifyPayloadGetDataAttributeType) (ret VerifyPayloadGetDataRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setVerifyPayloadGetDataAttributeType(arg *VerifyPayloadGetDataAttributeType, val VerifyPayloadGetDataRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for signature
|
||||
*/
|
||||
|
||||
// isByteArray
|
||||
type VerifyPayloadGetSignatureAttributeType = *[]byte
|
||||
type VerifyPayloadGetSignatureArgType = []byte
|
||||
type VerifyPayloadGetSignatureRetType = []byte
|
||||
|
||||
func getVerifyPayloadGetSignatureAttributeTypeOk(arg VerifyPayloadGetSignatureAttributeType) (ret VerifyPayloadGetSignatureRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setVerifyPayloadGetSignatureAttributeType(arg *VerifyPayloadGetSignatureAttributeType, val VerifyPayloadGetSignatureRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
// VerifyPayload struct for VerifyPayload
|
||||
type VerifyPayload struct {
|
||||
// The data to be verified. Encoded in base64.
|
||||
// REQUIRED
|
||||
Data VerifyPayloadGetDataAttributeType `json:"data" required:"true"`
|
||||
// The signature of the data. Encoded in base64.
|
||||
// REQUIRED
|
||||
Signature VerifyPayloadGetSignatureAttributeType `json:"signature" required:"true"`
|
||||
}
|
||||
|
||||
type _VerifyPayload VerifyPayload
|
||||
|
||||
// NewVerifyPayload instantiates a new VerifyPayload 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 NewVerifyPayload(data VerifyPayloadGetDataArgType, signature VerifyPayloadGetSignatureArgType) *VerifyPayload {
|
||||
this := VerifyPayload{}
|
||||
setVerifyPayloadGetDataAttributeType(&this.Data, data)
|
||||
setVerifyPayloadGetSignatureAttributeType(&this.Signature, signature)
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewVerifyPayloadWithDefaults instantiates a new VerifyPayload 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 NewVerifyPayloadWithDefaults() *VerifyPayload {
|
||||
this := VerifyPayload{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetData returns the Data field value
|
||||
func (o *VerifyPayload) GetData() (ret VerifyPayloadGetDataRetType) {
|
||||
ret, _ = o.GetDataOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetDataOk returns a tuple with the Data field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *VerifyPayload) GetDataOk() (ret VerifyPayloadGetDataRetType, ok bool) {
|
||||
return getVerifyPayloadGetDataAttributeTypeOk(o.Data)
|
||||
}
|
||||
|
||||
// SetData sets field value
|
||||
func (o *VerifyPayload) SetData(v VerifyPayloadGetDataRetType) {
|
||||
setVerifyPayloadGetDataAttributeType(&o.Data, v)
|
||||
}
|
||||
|
||||
// GetSignature returns the Signature field value
|
||||
func (o *VerifyPayload) GetSignature() (ret VerifyPayloadGetSignatureRetType) {
|
||||
ret, _ = o.GetSignatureOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetSignatureOk returns a tuple with the Signature field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *VerifyPayload) GetSignatureOk() (ret VerifyPayloadGetSignatureRetType, ok bool) {
|
||||
return getVerifyPayloadGetSignatureAttributeTypeOk(o.Signature)
|
||||
}
|
||||
|
||||
// SetSignature sets field value
|
||||
func (o *VerifyPayload) SetSignature(v VerifyPayloadGetSignatureRetType) {
|
||||
setVerifyPayloadGetSignatureAttributeType(&o.Signature, v)
|
||||
}
|
||||
|
||||
func (o VerifyPayload) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getVerifyPayloadGetDataAttributeTypeOk(o.Data); ok {
|
||||
toSerialize["Data"] = val
|
||||
}
|
||||
if val, ok := getVerifyPayloadGetSignatureAttributeTypeOk(o.Signature); ok {
|
||||
toSerialize["Signature"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableVerifyPayload struct {
|
||||
value *VerifyPayload
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableVerifyPayload) Get() *VerifyPayload {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableVerifyPayload) Set(val *VerifyPayload) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableVerifyPayload) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableVerifyPayload) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableVerifyPayload(val *VerifyPayload) *NullableVerifyPayload {
|
||||
return &NullableVerifyPayload{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableVerifyPayload) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableVerifyPayload) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
11
pkg/kmsbeta/model_verify_payload_test.go
Normal file
11
pkg/kmsbeta/model_verify_payload_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
561
pkg/kmsbeta/model_version.go
Normal file
561
pkg/kmsbeta/model_version.go
Normal file
|
|
@ -0,0 +1,561 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"time"
|
||||
)
|
||||
|
||||
// checks if the Version type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &Version{}
|
||||
|
||||
/*
|
||||
types and functions for createdAt
|
||||
*/
|
||||
|
||||
// isDateTime
|
||||
type VersionGetCreatedAtAttributeType = *time.Time
|
||||
type VersionGetCreatedAtArgType = time.Time
|
||||
type VersionGetCreatedAtRetType = time.Time
|
||||
|
||||
func getVersionGetCreatedAtAttributeTypeOk(arg VersionGetCreatedAtAttributeType) (ret VersionGetCreatedAtRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setVersionGetCreatedAtAttributeType(arg *VersionGetCreatedAtAttributeType, val VersionGetCreatedAtRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for destroyDate
|
||||
*/
|
||||
|
||||
// isDateTime
|
||||
type VersionGetDestroyDateAttributeType = *time.Time
|
||||
type VersionGetDestroyDateArgType = time.Time
|
||||
type VersionGetDestroyDateRetType = time.Time
|
||||
|
||||
func getVersionGetDestroyDateAttributeTypeOk(arg VersionGetDestroyDateAttributeType) (ret VersionGetDestroyDateRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setVersionGetDestroyDateAttributeType(arg *VersionGetDestroyDateAttributeType, val VersionGetDestroyDateRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for disabled
|
||||
*/
|
||||
|
||||
// isBoolean
|
||||
type VersiongetDisabledAttributeType = *bool
|
||||
type VersiongetDisabledArgType = bool
|
||||
type VersiongetDisabledRetType = bool
|
||||
|
||||
func getVersiongetDisabledAttributeTypeOk(arg VersiongetDisabledAttributeType) (ret VersiongetDisabledRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setVersiongetDisabledAttributeType(arg *VersiongetDisabledAttributeType, val VersiongetDisabledRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for keyId
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type VersionGetKeyIdAttributeType = *string
|
||||
|
||||
func getVersionGetKeyIdAttributeTypeOk(arg VersionGetKeyIdAttributeType) (ret VersionGetKeyIdRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setVersionGetKeyIdAttributeType(arg *VersionGetKeyIdAttributeType, val VersionGetKeyIdRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type VersionGetKeyIdArgType = string
|
||||
type VersionGetKeyIdRetType = string
|
||||
|
||||
/*
|
||||
types and functions for keyRingId
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type VersionGetKeyRingIdAttributeType = *string
|
||||
|
||||
func getVersionGetKeyRingIdAttributeTypeOk(arg VersionGetKeyRingIdAttributeType) (ret VersionGetKeyRingIdRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setVersionGetKeyRingIdAttributeType(arg *VersionGetKeyRingIdAttributeType, val VersionGetKeyRingIdRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type VersionGetKeyRingIdArgType = string
|
||||
type VersionGetKeyRingIdRetType = string
|
||||
|
||||
/*
|
||||
types and functions for number
|
||||
*/
|
||||
|
||||
// isLong
|
||||
type VersionGetNumberAttributeType = *int64
|
||||
type VersionGetNumberArgType = int64
|
||||
type VersionGetNumberRetType = int64
|
||||
|
||||
func getVersionGetNumberAttributeTypeOk(arg VersionGetNumberAttributeType) (ret VersionGetNumberRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setVersionGetNumberAttributeType(arg *VersionGetNumberAttributeType, val VersionGetNumberRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for publicKey
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type VersionGetPublicKeyAttributeType = *string
|
||||
|
||||
func getVersionGetPublicKeyAttributeTypeOk(arg VersionGetPublicKeyAttributeType) (ret VersionGetPublicKeyRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setVersionGetPublicKeyAttributeType(arg *VersionGetPublicKeyAttributeType, val VersionGetPublicKeyRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type VersionGetPublicKeyArgType = string
|
||||
type VersionGetPublicKeyRetType = string
|
||||
|
||||
/*
|
||||
types and functions for state
|
||||
*/
|
||||
|
||||
// isEnum
|
||||
|
||||
// VersionState The current state of the key.
|
||||
// value type for enums
|
||||
type VersionState string
|
||||
|
||||
// List of State
|
||||
const (
|
||||
VERSIONSTATE_ACTIVE VersionState = "active"
|
||||
VERSIONSTATE_CREATING VersionState = "creating"
|
||||
VERSIONSTATE_KEY_MATERIAL_INVALID VersionState = "key_material_invalid"
|
||||
VERSIONSTATE_KEY_MATERIAL_UNAVAILABLE VersionState = "key_material_unavailable"
|
||||
VERSIONSTATE_DISABLED VersionState = "disabled"
|
||||
VERSIONSTATE_DESTROYED VersionState = "destroyed"
|
||||
)
|
||||
|
||||
// All allowed values of Version enum
|
||||
var AllowedVersionStateEnumValues = []VersionState{
|
||||
"active",
|
||||
"creating",
|
||||
"key_material_invalid",
|
||||
"key_material_unavailable",
|
||||
"disabled",
|
||||
"destroyed",
|
||||
}
|
||||
|
||||
func (v *VersionState) 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 VersionState
|
||||
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 := VersionState(value)
|
||||
for _, existing := range AllowedVersionStateEnumValues {
|
||||
if existing == enumTypeValue {
|
||||
*v = enumTypeValue
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
return fmt.Errorf("%+v is not a valid Version", value)
|
||||
}
|
||||
|
||||
// NewVersionStateFromValue returns a pointer to a valid VersionState
|
||||
// for the value passed as argument, or an error if the value passed is not allowed by the enum
|
||||
func NewVersionStateFromValue(v VersionState) (*VersionState, error) {
|
||||
ev := VersionState(v)
|
||||
if ev.IsValid() {
|
||||
return &ev, nil
|
||||
} else {
|
||||
return nil, fmt.Errorf("invalid value '%v' for VersionState: valid values are %v", v, AllowedVersionStateEnumValues)
|
||||
}
|
||||
}
|
||||
|
||||
// IsValid return true if the value is valid for the enum, false otherwise
|
||||
func (v VersionState) IsValid() bool {
|
||||
for _, existing := range AllowedVersionStateEnumValues {
|
||||
if existing == v {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// Ptr returns reference to StateState value
|
||||
func (v VersionState) Ptr() *VersionState {
|
||||
return &v
|
||||
}
|
||||
|
||||
type NullableVersionState struct {
|
||||
value *VersionState
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableVersionState) Get() *VersionState {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableVersionState) Set(val *VersionState) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableVersionState) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableVersionState) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableVersionState(val *VersionState) *NullableVersionState {
|
||||
return &NullableVersionState{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableVersionState) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableVersionState) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
type VersionGetStateAttributeType = *VersionState
|
||||
type VersionGetStateArgType = VersionState
|
||||
type VersionGetStateRetType = VersionState
|
||||
|
||||
func getVersionGetStateAttributeTypeOk(arg VersionGetStateAttributeType) (ret VersionGetStateRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setVersionGetStateAttributeType(arg *VersionGetStateAttributeType, val VersionGetStateRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
// Version struct for Version
|
||||
type Version struct {
|
||||
// The date and time the creation of the key was triggered.
|
||||
// REQUIRED
|
||||
CreatedAt VersionGetCreatedAtAttributeType `json:"createdAt" required:"true"`
|
||||
// The scheduled date when a version's key material will be erased completely from the backend
|
||||
DestroyDate VersionGetDestroyDateAttributeType `json:"destroyDate,omitempty"`
|
||||
// States whether versions is enabled or disabled.
|
||||
// REQUIRED
|
||||
Disabled VersiongetDisabledAttributeType `json:"disabled" required:"true"`
|
||||
// The unique id of the key this version is assigned to.
|
||||
// REQUIRED
|
||||
KeyId VersionGetKeyIdAttributeType `json:"keyId" required:"true"`
|
||||
// The unique id of the key ring the key of this version is assigned to.
|
||||
// REQUIRED
|
||||
KeyRingId VersionGetKeyRingIdAttributeType `json:"keyRingId" required:"true"`
|
||||
// A sequential number which identifies the key versions.
|
||||
// REQUIRED
|
||||
Number VersionGetNumberAttributeType `json:"number" required:"true"`
|
||||
// The public key of the key version. Only present in asymmetric keys.
|
||||
PublicKey VersionGetPublicKeyAttributeType `json:"publicKey,omitempty"`
|
||||
// The current state of the key.
|
||||
// REQUIRED
|
||||
State VersionGetStateAttributeType `json:"state" required:"true"`
|
||||
}
|
||||
|
||||
type _Version Version
|
||||
|
||||
// NewVersion instantiates a new Version 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 NewVersion(createdAt VersionGetCreatedAtArgType, disabled VersiongetDisabledArgType, keyId VersionGetKeyIdArgType, keyRingId VersionGetKeyRingIdArgType, number VersionGetNumberArgType, state VersionGetStateArgType) *Version {
|
||||
this := Version{}
|
||||
setVersionGetCreatedAtAttributeType(&this.CreatedAt, createdAt)
|
||||
setVersiongetDisabledAttributeType(&this.Disabled, disabled)
|
||||
setVersionGetKeyIdAttributeType(&this.KeyId, keyId)
|
||||
setVersionGetKeyRingIdAttributeType(&this.KeyRingId, keyRingId)
|
||||
setVersionGetNumberAttributeType(&this.Number, number)
|
||||
setVersionGetStateAttributeType(&this.State, state)
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewVersionWithDefaults instantiates a new Version 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 NewVersionWithDefaults() *Version {
|
||||
this := Version{}
|
||||
var disabled bool = false
|
||||
this.Disabled = &disabled
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetCreatedAt returns the CreatedAt field value
|
||||
func (o *Version) GetCreatedAt() (ret VersionGetCreatedAtRetType) {
|
||||
ret, _ = o.GetCreatedAtOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetCreatedAtOk returns a tuple with the CreatedAt field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Version) GetCreatedAtOk() (ret VersionGetCreatedAtRetType, ok bool) {
|
||||
return getVersionGetCreatedAtAttributeTypeOk(o.CreatedAt)
|
||||
}
|
||||
|
||||
// SetCreatedAt sets field value
|
||||
func (o *Version) SetCreatedAt(v VersionGetCreatedAtRetType) {
|
||||
setVersionGetCreatedAtAttributeType(&o.CreatedAt, v)
|
||||
}
|
||||
|
||||
// GetDestroyDate returns the DestroyDate field value if set, zero value otherwise.
|
||||
func (o *Version) GetDestroyDate() (res VersionGetDestroyDateRetType) {
|
||||
res, _ = o.GetDestroyDateOk()
|
||||
return
|
||||
}
|
||||
|
||||
// GetDestroyDateOk returns a tuple with the DestroyDate field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Version) GetDestroyDateOk() (ret VersionGetDestroyDateRetType, ok bool) {
|
||||
return getVersionGetDestroyDateAttributeTypeOk(o.DestroyDate)
|
||||
}
|
||||
|
||||
// HasDestroyDate returns a boolean if a field has been set.
|
||||
func (o *Version) HasDestroyDate() bool {
|
||||
_, ok := o.GetDestroyDateOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetDestroyDate gets a reference to the given time.Time and assigns it to the DestroyDate field.
|
||||
func (o *Version) SetDestroyDate(v VersionGetDestroyDateRetType) {
|
||||
setVersionGetDestroyDateAttributeType(&o.DestroyDate, v)
|
||||
}
|
||||
|
||||
// GetDisabled returns the Disabled field value
|
||||
func (o *Version) GetDisabled() (ret VersiongetDisabledRetType) {
|
||||
ret, _ = o.GetDisabledOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetDisabledOk returns a tuple with the Disabled field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Version) GetDisabledOk() (ret VersiongetDisabledRetType, ok bool) {
|
||||
return getVersiongetDisabledAttributeTypeOk(o.Disabled)
|
||||
}
|
||||
|
||||
// SetDisabled sets field value
|
||||
func (o *Version) SetDisabled(v VersiongetDisabledRetType) {
|
||||
setVersiongetDisabledAttributeType(&o.Disabled, v)
|
||||
}
|
||||
|
||||
// GetKeyId returns the KeyId field value
|
||||
func (o *Version) GetKeyId() (ret VersionGetKeyIdRetType) {
|
||||
ret, _ = o.GetKeyIdOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetKeyIdOk returns a tuple with the KeyId field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Version) GetKeyIdOk() (ret VersionGetKeyIdRetType, ok bool) {
|
||||
return getVersionGetKeyIdAttributeTypeOk(o.KeyId)
|
||||
}
|
||||
|
||||
// SetKeyId sets field value
|
||||
func (o *Version) SetKeyId(v VersionGetKeyIdRetType) {
|
||||
setVersionGetKeyIdAttributeType(&o.KeyId, v)
|
||||
}
|
||||
|
||||
// GetKeyRingId returns the KeyRingId field value
|
||||
func (o *Version) GetKeyRingId() (ret VersionGetKeyRingIdRetType) {
|
||||
ret, _ = o.GetKeyRingIdOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetKeyRingIdOk returns a tuple with the KeyRingId field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Version) GetKeyRingIdOk() (ret VersionGetKeyRingIdRetType, ok bool) {
|
||||
return getVersionGetKeyRingIdAttributeTypeOk(o.KeyRingId)
|
||||
}
|
||||
|
||||
// SetKeyRingId sets field value
|
||||
func (o *Version) SetKeyRingId(v VersionGetKeyRingIdRetType) {
|
||||
setVersionGetKeyRingIdAttributeType(&o.KeyRingId, v)
|
||||
}
|
||||
|
||||
// GetNumber returns the Number field value
|
||||
func (o *Version) GetNumber() (ret VersionGetNumberRetType) {
|
||||
ret, _ = o.GetNumberOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetNumberOk returns a tuple with the Number field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Version) GetNumberOk() (ret VersionGetNumberRetType, ok bool) {
|
||||
return getVersionGetNumberAttributeTypeOk(o.Number)
|
||||
}
|
||||
|
||||
// SetNumber sets field value
|
||||
func (o *Version) SetNumber(v VersionGetNumberRetType) {
|
||||
setVersionGetNumberAttributeType(&o.Number, v)
|
||||
}
|
||||
|
||||
// GetPublicKey returns the PublicKey field value if set, zero value otherwise.
|
||||
func (o *Version) GetPublicKey() (res VersionGetPublicKeyRetType) {
|
||||
res, _ = o.GetPublicKeyOk()
|
||||
return
|
||||
}
|
||||
|
||||
// GetPublicKeyOk returns a tuple with the PublicKey field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Version) GetPublicKeyOk() (ret VersionGetPublicKeyRetType, ok bool) {
|
||||
return getVersionGetPublicKeyAttributeTypeOk(o.PublicKey)
|
||||
}
|
||||
|
||||
// HasPublicKey returns a boolean if a field has been set.
|
||||
func (o *Version) HasPublicKey() bool {
|
||||
_, ok := o.GetPublicKeyOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetPublicKey gets a reference to the given string and assigns it to the PublicKey field.
|
||||
func (o *Version) SetPublicKey(v VersionGetPublicKeyRetType) {
|
||||
setVersionGetPublicKeyAttributeType(&o.PublicKey, v)
|
||||
}
|
||||
|
||||
// GetState returns the State field value
|
||||
func (o *Version) GetState() (ret VersionGetStateRetType) {
|
||||
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 *Version) GetStateOk() (ret VersionGetStateRetType, ok bool) {
|
||||
return getVersionGetStateAttributeTypeOk(o.State)
|
||||
}
|
||||
|
||||
// SetState sets field value
|
||||
func (o *Version) SetState(v VersionGetStateRetType) {
|
||||
setVersionGetStateAttributeType(&o.State, v)
|
||||
}
|
||||
|
||||
func (o Version) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getVersionGetCreatedAtAttributeTypeOk(o.CreatedAt); ok {
|
||||
toSerialize["CreatedAt"] = val
|
||||
}
|
||||
if val, ok := getVersionGetDestroyDateAttributeTypeOk(o.DestroyDate); ok {
|
||||
toSerialize["DestroyDate"] = val
|
||||
}
|
||||
if val, ok := getVersiongetDisabledAttributeTypeOk(o.Disabled); ok {
|
||||
toSerialize["Disabled"] = val
|
||||
}
|
||||
if val, ok := getVersionGetKeyIdAttributeTypeOk(o.KeyId); ok {
|
||||
toSerialize["KeyId"] = val
|
||||
}
|
||||
if val, ok := getVersionGetKeyRingIdAttributeTypeOk(o.KeyRingId); ok {
|
||||
toSerialize["KeyRingId"] = val
|
||||
}
|
||||
if val, ok := getVersionGetNumberAttributeTypeOk(o.Number); ok {
|
||||
toSerialize["Number"] = val
|
||||
}
|
||||
if val, ok := getVersionGetPublicKeyAttributeTypeOk(o.PublicKey); ok {
|
||||
toSerialize["PublicKey"] = val
|
||||
}
|
||||
if val, ok := getVersionGetStateAttributeTypeOk(o.State); ok {
|
||||
toSerialize["State"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableVersion struct {
|
||||
value *Version
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableVersion) Get() *Version {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableVersion) Set(val *Version) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableVersion) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableVersion) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableVersion(val *Version) *NullableVersion {
|
||||
return &NullableVersion{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableVersion) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableVersion) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
125
pkg/kmsbeta/model_version_list.go
Normal file
125
pkg/kmsbeta/model_version_list.go
Normal file
|
|
@ -0,0 +1,125 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the VersionList type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &VersionList{}
|
||||
|
||||
/*
|
||||
types and functions for versions
|
||||
*/
|
||||
|
||||
// isArray
|
||||
type VersionListGetVersionsAttributeType = *[]Version
|
||||
type VersionListGetVersionsArgType = []Version
|
||||
type VersionListGetVersionsRetType = []Version
|
||||
|
||||
func getVersionListGetVersionsAttributeTypeOk(arg VersionListGetVersionsAttributeType) (ret VersionListGetVersionsRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setVersionListGetVersionsAttributeType(arg *VersionListGetVersionsAttributeType, val VersionListGetVersionsRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
// VersionList struct for VersionList
|
||||
type VersionList struct {
|
||||
// REQUIRED
|
||||
Versions VersionListGetVersionsAttributeType `json:"versions" required:"true"`
|
||||
}
|
||||
|
||||
type _VersionList VersionList
|
||||
|
||||
// NewVersionList instantiates a new VersionList 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 NewVersionList(versions VersionListGetVersionsArgType) *VersionList {
|
||||
this := VersionList{}
|
||||
setVersionListGetVersionsAttributeType(&this.Versions, versions)
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewVersionListWithDefaults instantiates a new VersionList 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 NewVersionListWithDefaults() *VersionList {
|
||||
this := VersionList{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetVersions returns the Versions field value
|
||||
func (o *VersionList) GetVersions() (ret VersionListGetVersionsRetType) {
|
||||
ret, _ = o.GetVersionsOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetVersionsOk returns a tuple with the Versions field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *VersionList) GetVersionsOk() (ret VersionListGetVersionsRetType, ok bool) {
|
||||
return getVersionListGetVersionsAttributeTypeOk(o.Versions)
|
||||
}
|
||||
|
||||
// SetVersions sets field value
|
||||
func (o *VersionList) SetVersions(v VersionListGetVersionsRetType) {
|
||||
setVersionListGetVersionsAttributeType(&o.Versions, v)
|
||||
}
|
||||
|
||||
func (o VersionList) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getVersionListGetVersionsAttributeTypeOk(o.Versions); ok {
|
||||
toSerialize["Versions"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableVersionList struct {
|
||||
value *VersionList
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableVersionList) Get() *VersionList {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableVersionList) Set(val *VersionList) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableVersionList) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableVersionList) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableVersionList(val *VersionList) *NullableVersionList {
|
||||
return &NullableVersionList{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableVersionList) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableVersionList) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
11
pkg/kmsbeta/model_version_list_test.go
Normal file
11
pkg/kmsbeta/model_version_list_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
86
pkg/kmsbeta/model_version_test.go
Normal file
86
pkg/kmsbeta/model_version_test.go
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
// isEnum
|
||||
|
||||
func TestVersionState_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(`"active"`),
|
||||
},
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: `success - possible enum value no. 2`,
|
||||
args: args{
|
||||
src: []byte(`"creating"`),
|
||||
},
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: `success - possible enum value no. 3`,
|
||||
args: args{
|
||||
src: []byte(`"key_material_invalid"`),
|
||||
},
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: `success - possible enum value no. 4`,
|
||||
args: args{
|
||||
src: []byte(`"key_material_unavailable"`),
|
||||
},
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: `success - possible enum value no. 5`,
|
||||
args: args{
|
||||
src: []byte(`"disabled"`),
|
||||
},
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: `success - possible enum value no. 6`,
|
||||
args: args{
|
||||
src: []byte(`"destroyed"`),
|
||||
},
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: "fail",
|
||||
args: args{
|
||||
src: []byte("\"FOOBAR\""),
|
||||
},
|
||||
wantErr: true,
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
v := VersionState("")
|
||||
if err := v.UnmarshalJSON(tt.args.src); (err != nil) != tt.wantErr {
|
||||
t.Errorf("UnmarshalJSON() error = %v, wantErr %v", err, tt.wantErr)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
127
pkg/kmsbeta/model_wrapping_algorithm.go
Normal file
127
pkg/kmsbeta/model_wrapping_algorithm.go
Normal file
|
|
@ -0,0 +1,127 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// WrappingAlgorithm The wrapping algorithm used to wrap the key to import.
|
||||
type WrappingAlgorithm string
|
||||
|
||||
// List of wrappingAlgorithm
|
||||
const (
|
||||
WRAPPINGALGORITHM__2048_OAEP_SHA256 WrappingAlgorithm = "rsa_2048_oaep_sha256"
|
||||
WRAPPINGALGORITHM__3072_OAEP_SHA256 WrappingAlgorithm = "rsa_3072_oaep_sha256"
|
||||
WRAPPINGALGORITHM__4096_OAEP_SHA256 WrappingAlgorithm = "rsa_4096_oaep_sha256"
|
||||
WRAPPINGALGORITHM__4096_OAEP_SHA512 WrappingAlgorithm = "rsa_4096_oaep_sha512"
|
||||
WRAPPINGALGORITHM__2048_OAEP_SHA256_AES_256_KEY_WRAP WrappingAlgorithm = "rsa_2048_oaep_sha256_aes_256_key_wrap"
|
||||
WRAPPINGALGORITHM__3072_OAEP_SHA256_AES_256_KEY_WRAP WrappingAlgorithm = "rsa_3072_oaep_sha256_aes_256_key_wrap"
|
||||
WRAPPINGALGORITHM__4096_OAEP_SHA256_AES_256_KEY_WRAP WrappingAlgorithm = "rsa_4096_oaep_sha256_aes_256_key_wrap"
|
||||
WRAPPINGALGORITHM__4096_OAEP_SHA512_AES_256_KEY_WRAP WrappingAlgorithm = "rsa_4096_oaep_sha512_aes_256_key_wrap"
|
||||
)
|
||||
|
||||
// All allowed values of WrappingAlgorithm enum
|
||||
var AllowedWrappingAlgorithmEnumValues = []WrappingAlgorithm{
|
||||
"rsa_2048_oaep_sha256",
|
||||
"rsa_3072_oaep_sha256",
|
||||
"rsa_4096_oaep_sha256",
|
||||
"rsa_4096_oaep_sha512",
|
||||
"rsa_2048_oaep_sha256_aes_256_key_wrap",
|
||||
"rsa_3072_oaep_sha256_aes_256_key_wrap",
|
||||
"rsa_4096_oaep_sha256_aes_256_key_wrap",
|
||||
"rsa_4096_oaep_sha512_aes_256_key_wrap",
|
||||
}
|
||||
|
||||
func (v *WrappingAlgorithm) 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 := WrappingAlgorithm(value)
|
||||
for _, existing := range AllowedWrappingAlgorithmEnumValues {
|
||||
if existing == enumTypeValue {
|
||||
*v = enumTypeValue
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
return fmt.Errorf("%+v is not a valid WrappingAlgorithm", value)
|
||||
}
|
||||
|
||||
// NewWrappingAlgorithmFromValue returns a pointer to a valid WrappingAlgorithm
|
||||
// for the value passed as argument, or an error if the value passed is not allowed by the enum
|
||||
func NewWrappingAlgorithmFromValue(v string) (*WrappingAlgorithm, error) {
|
||||
ev := WrappingAlgorithm(v)
|
||||
if ev.IsValid() {
|
||||
return &ev, nil
|
||||
} else {
|
||||
return nil, fmt.Errorf("invalid value '%v' for WrappingAlgorithm: valid values are %v", v, AllowedWrappingAlgorithmEnumValues)
|
||||
}
|
||||
}
|
||||
|
||||
// IsValid return true if the value is valid for the enum, false otherwise
|
||||
func (v WrappingAlgorithm) IsValid() bool {
|
||||
for _, existing := range AllowedWrappingAlgorithmEnumValues {
|
||||
if existing == v {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// Ptr returns reference to wrappingAlgorithm value
|
||||
func (v WrappingAlgorithm) Ptr() *WrappingAlgorithm {
|
||||
return &v
|
||||
}
|
||||
|
||||
type NullableWrappingAlgorithm struct {
|
||||
value *WrappingAlgorithm
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableWrappingAlgorithm) Get() *WrappingAlgorithm {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableWrappingAlgorithm) Set(val *WrappingAlgorithm) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableWrappingAlgorithm) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableWrappingAlgorithm) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableWrappingAlgorithm(val *WrappingAlgorithm) *NullableWrappingAlgorithm {
|
||||
return &NullableWrappingAlgorithm{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableWrappingAlgorithm) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableWrappingAlgorithm) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
11
pkg/kmsbeta/model_wrapping_algorithm_test.go
Normal file
11
pkg/kmsbeta/model_wrapping_algorithm_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
776
pkg/kmsbeta/model_wrapping_key.go
Normal file
776
pkg/kmsbeta/model_wrapping_key.go
Normal file
|
|
@ -0,0 +1,776 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"time"
|
||||
)
|
||||
|
||||
// checks if the WrappingKey type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &WrappingKey{}
|
||||
|
||||
/*
|
||||
types and functions for access_scope
|
||||
*/
|
||||
|
||||
// isEnumRef
|
||||
type WrappingKeyGetAccessScopeAttributeType = *AccessScope
|
||||
type WrappingKeyGetAccessScopeArgType = AccessScope
|
||||
type WrappingKeyGetAccessScopeRetType = AccessScope
|
||||
|
||||
func getWrappingKeyGetAccessScopeAttributeTypeOk(arg WrappingKeyGetAccessScopeAttributeType) (ret WrappingKeyGetAccessScopeRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setWrappingKeyGetAccessScopeAttributeType(arg *WrappingKeyGetAccessScopeAttributeType, val WrappingKeyGetAccessScopeRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for algorithm
|
||||
*/
|
||||
|
||||
// isEnumRef
|
||||
type WrappingKeyGetAlgorithmAttributeType = *WrappingAlgorithm
|
||||
type WrappingKeyGetAlgorithmArgType = WrappingAlgorithm
|
||||
type WrappingKeyGetAlgorithmRetType = WrappingAlgorithm
|
||||
|
||||
func getWrappingKeyGetAlgorithmAttributeTypeOk(arg WrappingKeyGetAlgorithmAttributeType) (ret WrappingKeyGetAlgorithmRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setWrappingKeyGetAlgorithmAttributeType(arg *WrappingKeyGetAlgorithmAttributeType, val WrappingKeyGetAlgorithmRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for backend
|
||||
*/
|
||||
|
||||
// isEnumRef
|
||||
type WrappingKeyGetBackendAttributeType = *Backend
|
||||
type WrappingKeyGetBackendArgType = Backend
|
||||
type WrappingKeyGetBackendRetType = Backend
|
||||
|
||||
func getWrappingKeyGetBackendAttributeTypeOk(arg WrappingKeyGetBackendAttributeType) (ret WrappingKeyGetBackendRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setWrappingKeyGetBackendAttributeType(arg *WrappingKeyGetBackendAttributeType, val WrappingKeyGetBackendRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for createdAt
|
||||
*/
|
||||
|
||||
// isDateTime
|
||||
type WrappingKeyGetCreatedAtAttributeType = *time.Time
|
||||
type WrappingKeyGetCreatedAtArgType = time.Time
|
||||
type WrappingKeyGetCreatedAtRetType = time.Time
|
||||
|
||||
func getWrappingKeyGetCreatedAtAttributeTypeOk(arg WrappingKeyGetCreatedAtAttributeType) (ret WrappingKeyGetCreatedAtRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setWrappingKeyGetCreatedAtAttributeType(arg *WrappingKeyGetCreatedAtAttributeType, val WrappingKeyGetCreatedAtRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for description
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type WrappingKeyGetDescriptionAttributeType = *string
|
||||
|
||||
func getWrappingKeyGetDescriptionAttributeTypeOk(arg WrappingKeyGetDescriptionAttributeType) (ret WrappingKeyGetDescriptionRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setWrappingKeyGetDescriptionAttributeType(arg *WrappingKeyGetDescriptionAttributeType, val WrappingKeyGetDescriptionRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type WrappingKeyGetDescriptionArgType = string
|
||||
type WrappingKeyGetDescriptionRetType = string
|
||||
|
||||
/*
|
||||
types and functions for displayName
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type WrappingKeyGetDisplayNameAttributeType = *string
|
||||
|
||||
func getWrappingKeyGetDisplayNameAttributeTypeOk(arg WrappingKeyGetDisplayNameAttributeType) (ret WrappingKeyGetDisplayNameRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setWrappingKeyGetDisplayNameAttributeType(arg *WrappingKeyGetDisplayNameAttributeType, val WrappingKeyGetDisplayNameRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type WrappingKeyGetDisplayNameArgType = string
|
||||
type WrappingKeyGetDisplayNameRetType = string
|
||||
|
||||
/*
|
||||
types and functions for expiresAt
|
||||
*/
|
||||
|
||||
// isDateTime
|
||||
type WrappingKeyGetExpiresAtAttributeType = *time.Time
|
||||
type WrappingKeyGetExpiresAtArgType = time.Time
|
||||
type WrappingKeyGetExpiresAtRetType = time.Time
|
||||
|
||||
func getWrappingKeyGetExpiresAtAttributeTypeOk(arg WrappingKeyGetExpiresAtAttributeType) (ret WrappingKeyGetExpiresAtRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setWrappingKeyGetExpiresAtAttributeType(arg *WrappingKeyGetExpiresAtAttributeType, val WrappingKeyGetExpiresAtRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for id
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type WrappingKeyGetIdAttributeType = *string
|
||||
|
||||
func getWrappingKeyGetIdAttributeTypeOk(arg WrappingKeyGetIdAttributeType) (ret WrappingKeyGetIdRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setWrappingKeyGetIdAttributeType(arg *WrappingKeyGetIdAttributeType, val WrappingKeyGetIdRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type WrappingKeyGetIdArgType = string
|
||||
type WrappingKeyGetIdRetType = string
|
||||
|
||||
/*
|
||||
types and functions for keyRingId
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type WrappingKeyGetKeyRingIdAttributeType = *string
|
||||
|
||||
func getWrappingKeyGetKeyRingIdAttributeTypeOk(arg WrappingKeyGetKeyRingIdAttributeType) (ret WrappingKeyGetKeyRingIdRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setWrappingKeyGetKeyRingIdAttributeType(arg *WrappingKeyGetKeyRingIdAttributeType, val WrappingKeyGetKeyRingIdRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type WrappingKeyGetKeyRingIdArgType = string
|
||||
type WrappingKeyGetKeyRingIdRetType = string
|
||||
|
||||
/*
|
||||
types and functions for protection
|
||||
*/
|
||||
|
||||
// isEnumRef
|
||||
type WrappingKeyGetProtectionAttributeType = *Protection
|
||||
type WrappingKeyGetProtectionArgType = Protection
|
||||
type WrappingKeyGetProtectionRetType = Protection
|
||||
|
||||
func getWrappingKeyGetProtectionAttributeTypeOk(arg WrappingKeyGetProtectionAttributeType) (ret WrappingKeyGetProtectionRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setWrappingKeyGetProtectionAttributeType(arg *WrappingKeyGetProtectionAttributeType, val WrappingKeyGetProtectionRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for publicKey
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type WrappingKeyGetPublicKeyAttributeType = *string
|
||||
|
||||
func getWrappingKeyGetPublicKeyAttributeTypeOk(arg WrappingKeyGetPublicKeyAttributeType) (ret WrappingKeyGetPublicKeyRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setWrappingKeyGetPublicKeyAttributeType(arg *WrappingKeyGetPublicKeyAttributeType, val WrappingKeyGetPublicKeyRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type WrappingKeyGetPublicKeyArgType = string
|
||||
type WrappingKeyGetPublicKeyRetType = string
|
||||
|
||||
/*
|
||||
types and functions for purpose
|
||||
*/
|
||||
|
||||
// isEnumRef
|
||||
type WrappingKeyGetPurposeAttributeType = *WrappingPurpose
|
||||
type WrappingKeyGetPurposeArgType = WrappingPurpose
|
||||
type WrappingKeyGetPurposeRetType = WrappingPurpose
|
||||
|
||||
func getWrappingKeyGetPurposeAttributeTypeOk(arg WrappingKeyGetPurposeAttributeType) (ret WrappingKeyGetPurposeRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setWrappingKeyGetPurposeAttributeType(arg *WrappingKeyGetPurposeAttributeType, val WrappingKeyGetPurposeRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for state
|
||||
*/
|
||||
|
||||
// isEnum
|
||||
|
||||
// WrappingKeyState The current state of the wrapping key.
|
||||
// value type for enums
|
||||
type WrappingKeyState string
|
||||
|
||||
// List of State
|
||||
const (
|
||||
WRAPPINGKEYSTATE_ACTIVE WrappingKeyState = "active"
|
||||
WRAPPINGKEYSTATE_CREATING WrappingKeyState = "creating"
|
||||
WRAPPINGKEYSTATE_EXPIRED WrappingKeyState = "expired"
|
||||
WRAPPINGKEYSTATE_DELETED WrappingKeyState = "deleted"
|
||||
WRAPPINGKEYSTATE_KEY_MATERIAL_UNAVAILABLE WrappingKeyState = "key_material_unavailable"
|
||||
)
|
||||
|
||||
// All allowed values of WrappingKey enum
|
||||
var AllowedWrappingKeyStateEnumValues = []WrappingKeyState{
|
||||
"active",
|
||||
"creating",
|
||||
"expired",
|
||||
"deleted",
|
||||
"key_material_unavailable",
|
||||
}
|
||||
|
||||
func (v *WrappingKeyState) 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 WrappingKeyState
|
||||
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 := WrappingKeyState(value)
|
||||
for _, existing := range AllowedWrappingKeyStateEnumValues {
|
||||
if existing == enumTypeValue {
|
||||
*v = enumTypeValue
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
return fmt.Errorf("%+v is not a valid WrappingKey", value)
|
||||
}
|
||||
|
||||
// NewWrappingKeyStateFromValue returns a pointer to a valid WrappingKeyState
|
||||
// for the value passed as argument, or an error if the value passed is not allowed by the enum
|
||||
func NewWrappingKeyStateFromValue(v WrappingKeyState) (*WrappingKeyState, error) {
|
||||
ev := WrappingKeyState(v)
|
||||
if ev.IsValid() {
|
||||
return &ev, nil
|
||||
} else {
|
||||
return nil, fmt.Errorf("invalid value '%v' for WrappingKeyState: valid values are %v", v, AllowedWrappingKeyStateEnumValues)
|
||||
}
|
||||
}
|
||||
|
||||
// IsValid return true if the value is valid for the enum, false otherwise
|
||||
func (v WrappingKeyState) IsValid() bool {
|
||||
for _, existing := range AllowedWrappingKeyStateEnumValues {
|
||||
if existing == v {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// Ptr returns reference to StateState value
|
||||
func (v WrappingKeyState) Ptr() *WrappingKeyState {
|
||||
return &v
|
||||
}
|
||||
|
||||
type NullableWrappingKeyState struct {
|
||||
value *WrappingKeyState
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableWrappingKeyState) Get() *WrappingKeyState {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableWrappingKeyState) Set(val *WrappingKeyState) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableWrappingKeyState) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableWrappingKeyState) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableWrappingKeyState(val *WrappingKeyState) *NullableWrappingKeyState {
|
||||
return &NullableWrappingKeyState{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableWrappingKeyState) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableWrappingKeyState) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
type WrappingKeyGetStateAttributeType = *WrappingKeyState
|
||||
type WrappingKeyGetStateArgType = WrappingKeyState
|
||||
type WrappingKeyGetStateRetType = WrappingKeyState
|
||||
|
||||
func getWrappingKeyGetStateAttributeTypeOk(arg WrappingKeyGetStateAttributeType) (ret WrappingKeyGetStateRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setWrappingKeyGetStateAttributeType(arg *WrappingKeyGetStateAttributeType, val WrappingKeyGetStateRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
// WrappingKey struct for WrappingKey
|
||||
type WrappingKey struct {
|
||||
// REQUIRED
|
||||
AccessScope WrappingKeyGetAccessScopeAttributeType `json:"access_scope" required:"true"`
|
||||
// REQUIRED
|
||||
Algorithm WrappingKeyGetAlgorithmAttributeType `json:"algorithm" required:"true"`
|
||||
// Deprecated: Check the GitHub changelog for alternatives
|
||||
// REQUIRED
|
||||
Backend WrappingKeyGetBackendAttributeType `json:"backend" required:"true"`
|
||||
// The date and time the creation of the wrapping key was triggered.
|
||||
// REQUIRED
|
||||
CreatedAt WrappingKeyGetCreatedAtAttributeType `json:"createdAt" required:"true"`
|
||||
// A user chosen description to distinguish multiple wrapping keys.
|
||||
// REQUIRED
|
||||
Description WrappingKeyGetDescriptionAttributeType `json:"description" required:"true"`
|
||||
// The display name to distinguish multiple wrapping keys.
|
||||
// REQUIRED
|
||||
DisplayName WrappingKeyGetDisplayNameAttributeType `json:"displayName" required:"true"`
|
||||
// The date and time the wrapping key will expire.
|
||||
// REQUIRED
|
||||
ExpiresAt WrappingKeyGetExpiresAtAttributeType `json:"expiresAt" required:"true"`
|
||||
// A auto generated unique id which identifies the wrapping keys.
|
||||
// REQUIRED
|
||||
Id WrappingKeyGetIdAttributeType `json:"id" required:"true"`
|
||||
// The unique id of the key ring this wrapping key is assigned to.
|
||||
// REQUIRED
|
||||
KeyRingId WrappingKeyGetKeyRingIdAttributeType `json:"keyRingId" required:"true"`
|
||||
// REQUIRED
|
||||
Protection WrappingKeyGetProtectionAttributeType `json:"protection" required:"true"`
|
||||
// The public key of the wrapping key.
|
||||
PublicKey WrappingKeyGetPublicKeyAttributeType `json:"publicKey,omitempty"`
|
||||
// REQUIRED
|
||||
Purpose WrappingKeyGetPurposeAttributeType `json:"purpose" required:"true"`
|
||||
// The current state of the wrapping key.
|
||||
// REQUIRED
|
||||
State WrappingKeyGetStateAttributeType `json:"state" required:"true"`
|
||||
}
|
||||
|
||||
type _WrappingKey WrappingKey
|
||||
|
||||
// NewWrappingKey instantiates a new WrappingKey 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 NewWrappingKey(accessScope WrappingKeyGetAccessScopeArgType, algorithm WrappingKeyGetAlgorithmArgType, backend WrappingKeyGetBackendArgType, createdAt WrappingKeyGetCreatedAtArgType, description WrappingKeyGetDescriptionArgType, displayName WrappingKeyGetDisplayNameArgType, expiresAt WrappingKeyGetExpiresAtArgType, id WrappingKeyGetIdArgType, keyRingId WrappingKeyGetKeyRingIdArgType, protection WrappingKeyGetProtectionArgType, purpose WrappingKeyGetPurposeArgType, state WrappingKeyGetStateArgType) *WrappingKey {
|
||||
this := WrappingKey{}
|
||||
setWrappingKeyGetAccessScopeAttributeType(&this.AccessScope, accessScope)
|
||||
setWrappingKeyGetAlgorithmAttributeType(&this.Algorithm, algorithm)
|
||||
setWrappingKeyGetBackendAttributeType(&this.Backend, backend)
|
||||
setWrappingKeyGetCreatedAtAttributeType(&this.CreatedAt, createdAt)
|
||||
setWrappingKeyGetDescriptionAttributeType(&this.Description, description)
|
||||
setWrappingKeyGetDisplayNameAttributeType(&this.DisplayName, displayName)
|
||||
setWrappingKeyGetExpiresAtAttributeType(&this.ExpiresAt, expiresAt)
|
||||
setWrappingKeyGetIdAttributeType(&this.Id, id)
|
||||
setWrappingKeyGetKeyRingIdAttributeType(&this.KeyRingId, keyRingId)
|
||||
setWrappingKeyGetProtectionAttributeType(&this.Protection, protection)
|
||||
setWrappingKeyGetPurposeAttributeType(&this.Purpose, purpose)
|
||||
setWrappingKeyGetStateAttributeType(&this.State, state)
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewWrappingKeyWithDefaults instantiates a new WrappingKey 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 NewWrappingKeyWithDefaults() *WrappingKey {
|
||||
this := WrappingKey{}
|
||||
var accessScope AccessScope = ACCESSSCOPE_PUBLIC
|
||||
this.AccessScope = &accessScope
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetAccessScope returns the AccessScope field value
|
||||
func (o *WrappingKey) GetAccessScope() (ret WrappingKeyGetAccessScopeRetType) {
|
||||
ret, _ = o.GetAccessScopeOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetAccessScopeOk returns a tuple with the AccessScope field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *WrappingKey) GetAccessScopeOk() (ret WrappingKeyGetAccessScopeRetType, ok bool) {
|
||||
return getWrappingKeyGetAccessScopeAttributeTypeOk(o.AccessScope)
|
||||
}
|
||||
|
||||
// SetAccessScope sets field value
|
||||
func (o *WrappingKey) SetAccessScope(v WrappingKeyGetAccessScopeRetType) {
|
||||
setWrappingKeyGetAccessScopeAttributeType(&o.AccessScope, v)
|
||||
}
|
||||
|
||||
// GetAlgorithm returns the Algorithm field value
|
||||
func (o *WrappingKey) GetAlgorithm() (ret WrappingKeyGetAlgorithmRetType) {
|
||||
ret, _ = o.GetAlgorithmOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetAlgorithmOk returns a tuple with the Algorithm field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *WrappingKey) GetAlgorithmOk() (ret WrappingKeyGetAlgorithmRetType, ok bool) {
|
||||
return getWrappingKeyGetAlgorithmAttributeTypeOk(o.Algorithm)
|
||||
}
|
||||
|
||||
// SetAlgorithm sets field value
|
||||
func (o *WrappingKey) SetAlgorithm(v WrappingKeyGetAlgorithmRetType) {
|
||||
setWrappingKeyGetAlgorithmAttributeType(&o.Algorithm, v)
|
||||
}
|
||||
|
||||
// GetBackend returns the Backend field value
|
||||
// Deprecated
|
||||
func (o *WrappingKey) GetBackend() (ret WrappingKeyGetBackendRetType) {
|
||||
ret, _ = o.GetBackendOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetBackendOk returns a tuple with the Backend field value
|
||||
// and a boolean to check if the value has been set.
|
||||
// Deprecated
|
||||
func (o *WrappingKey) GetBackendOk() (ret WrappingKeyGetBackendRetType, ok bool) {
|
||||
return getWrappingKeyGetBackendAttributeTypeOk(o.Backend)
|
||||
}
|
||||
|
||||
// SetBackend sets field value
|
||||
// Deprecated
|
||||
func (o *WrappingKey) SetBackend(v WrappingKeyGetBackendRetType) {
|
||||
setWrappingKeyGetBackendAttributeType(&o.Backend, v)
|
||||
}
|
||||
|
||||
// GetCreatedAt returns the CreatedAt field value
|
||||
func (o *WrappingKey) GetCreatedAt() (ret WrappingKeyGetCreatedAtRetType) {
|
||||
ret, _ = o.GetCreatedAtOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetCreatedAtOk returns a tuple with the CreatedAt field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *WrappingKey) GetCreatedAtOk() (ret WrappingKeyGetCreatedAtRetType, ok bool) {
|
||||
return getWrappingKeyGetCreatedAtAttributeTypeOk(o.CreatedAt)
|
||||
}
|
||||
|
||||
// SetCreatedAt sets field value
|
||||
func (o *WrappingKey) SetCreatedAt(v WrappingKeyGetCreatedAtRetType) {
|
||||
setWrappingKeyGetCreatedAtAttributeType(&o.CreatedAt, v)
|
||||
}
|
||||
|
||||
// GetDescription returns the Description field value
|
||||
func (o *WrappingKey) GetDescription() (ret WrappingKeyGetDescriptionRetType) {
|
||||
ret, _ = o.GetDescriptionOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetDescriptionOk returns a tuple with the Description field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *WrappingKey) GetDescriptionOk() (ret WrappingKeyGetDescriptionRetType, ok bool) {
|
||||
return getWrappingKeyGetDescriptionAttributeTypeOk(o.Description)
|
||||
}
|
||||
|
||||
// SetDescription sets field value
|
||||
func (o *WrappingKey) SetDescription(v WrappingKeyGetDescriptionRetType) {
|
||||
setWrappingKeyGetDescriptionAttributeType(&o.Description, v)
|
||||
}
|
||||
|
||||
// GetDisplayName returns the DisplayName field value
|
||||
func (o *WrappingKey) GetDisplayName() (ret WrappingKeyGetDisplayNameRetType) {
|
||||
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 *WrappingKey) GetDisplayNameOk() (ret WrappingKeyGetDisplayNameRetType, ok bool) {
|
||||
return getWrappingKeyGetDisplayNameAttributeTypeOk(o.DisplayName)
|
||||
}
|
||||
|
||||
// SetDisplayName sets field value
|
||||
func (o *WrappingKey) SetDisplayName(v WrappingKeyGetDisplayNameRetType) {
|
||||
setWrappingKeyGetDisplayNameAttributeType(&o.DisplayName, v)
|
||||
}
|
||||
|
||||
// GetExpiresAt returns the ExpiresAt field value
|
||||
func (o *WrappingKey) GetExpiresAt() (ret WrappingKeyGetExpiresAtRetType) {
|
||||
ret, _ = o.GetExpiresAtOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetExpiresAtOk returns a tuple with the ExpiresAt field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *WrappingKey) GetExpiresAtOk() (ret WrappingKeyGetExpiresAtRetType, ok bool) {
|
||||
return getWrappingKeyGetExpiresAtAttributeTypeOk(o.ExpiresAt)
|
||||
}
|
||||
|
||||
// SetExpiresAt sets field value
|
||||
func (o *WrappingKey) SetExpiresAt(v WrappingKeyGetExpiresAtRetType) {
|
||||
setWrappingKeyGetExpiresAtAttributeType(&o.ExpiresAt, v)
|
||||
}
|
||||
|
||||
// GetId returns the Id field value
|
||||
func (o *WrappingKey) GetId() (ret WrappingKeyGetIdRetType) {
|
||||
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 *WrappingKey) GetIdOk() (ret WrappingKeyGetIdRetType, ok bool) {
|
||||
return getWrappingKeyGetIdAttributeTypeOk(o.Id)
|
||||
}
|
||||
|
||||
// SetId sets field value
|
||||
func (o *WrappingKey) SetId(v WrappingKeyGetIdRetType) {
|
||||
setWrappingKeyGetIdAttributeType(&o.Id, v)
|
||||
}
|
||||
|
||||
// GetKeyRingId returns the KeyRingId field value
|
||||
func (o *WrappingKey) GetKeyRingId() (ret WrappingKeyGetKeyRingIdRetType) {
|
||||
ret, _ = o.GetKeyRingIdOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetKeyRingIdOk returns a tuple with the KeyRingId field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *WrappingKey) GetKeyRingIdOk() (ret WrappingKeyGetKeyRingIdRetType, ok bool) {
|
||||
return getWrappingKeyGetKeyRingIdAttributeTypeOk(o.KeyRingId)
|
||||
}
|
||||
|
||||
// SetKeyRingId sets field value
|
||||
func (o *WrappingKey) SetKeyRingId(v WrappingKeyGetKeyRingIdRetType) {
|
||||
setWrappingKeyGetKeyRingIdAttributeType(&o.KeyRingId, v)
|
||||
}
|
||||
|
||||
// GetProtection returns the Protection field value
|
||||
func (o *WrappingKey) GetProtection() (ret WrappingKeyGetProtectionRetType) {
|
||||
ret, _ = o.GetProtectionOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetProtectionOk returns a tuple with the Protection field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *WrappingKey) GetProtectionOk() (ret WrappingKeyGetProtectionRetType, ok bool) {
|
||||
return getWrappingKeyGetProtectionAttributeTypeOk(o.Protection)
|
||||
}
|
||||
|
||||
// SetProtection sets field value
|
||||
func (o *WrappingKey) SetProtection(v WrappingKeyGetProtectionRetType) {
|
||||
setWrappingKeyGetProtectionAttributeType(&o.Protection, v)
|
||||
}
|
||||
|
||||
// GetPublicKey returns the PublicKey field value if set, zero value otherwise.
|
||||
func (o *WrappingKey) GetPublicKey() (res WrappingKeyGetPublicKeyRetType) {
|
||||
res, _ = o.GetPublicKeyOk()
|
||||
return
|
||||
}
|
||||
|
||||
// GetPublicKeyOk returns a tuple with the PublicKey field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *WrappingKey) GetPublicKeyOk() (ret WrappingKeyGetPublicKeyRetType, ok bool) {
|
||||
return getWrappingKeyGetPublicKeyAttributeTypeOk(o.PublicKey)
|
||||
}
|
||||
|
||||
// HasPublicKey returns a boolean if a field has been set.
|
||||
func (o *WrappingKey) HasPublicKey() bool {
|
||||
_, ok := o.GetPublicKeyOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetPublicKey gets a reference to the given string and assigns it to the PublicKey field.
|
||||
func (o *WrappingKey) SetPublicKey(v WrappingKeyGetPublicKeyRetType) {
|
||||
setWrappingKeyGetPublicKeyAttributeType(&o.PublicKey, v)
|
||||
}
|
||||
|
||||
// GetPurpose returns the Purpose field value
|
||||
func (o *WrappingKey) GetPurpose() (ret WrappingKeyGetPurposeRetType) {
|
||||
ret, _ = o.GetPurposeOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetPurposeOk returns a tuple with the Purpose field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *WrappingKey) GetPurposeOk() (ret WrappingKeyGetPurposeRetType, ok bool) {
|
||||
return getWrappingKeyGetPurposeAttributeTypeOk(o.Purpose)
|
||||
}
|
||||
|
||||
// SetPurpose sets field value
|
||||
func (o *WrappingKey) SetPurpose(v WrappingKeyGetPurposeRetType) {
|
||||
setWrappingKeyGetPurposeAttributeType(&o.Purpose, v)
|
||||
}
|
||||
|
||||
// GetState returns the State field value
|
||||
func (o *WrappingKey) GetState() (ret WrappingKeyGetStateRetType) {
|
||||
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 *WrappingKey) GetStateOk() (ret WrappingKeyGetStateRetType, ok bool) {
|
||||
return getWrappingKeyGetStateAttributeTypeOk(o.State)
|
||||
}
|
||||
|
||||
// SetState sets field value
|
||||
func (o *WrappingKey) SetState(v WrappingKeyGetStateRetType) {
|
||||
setWrappingKeyGetStateAttributeType(&o.State, v)
|
||||
}
|
||||
|
||||
func (o WrappingKey) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getWrappingKeyGetAccessScopeAttributeTypeOk(o.AccessScope); ok {
|
||||
toSerialize["AccessScope"] = val
|
||||
}
|
||||
if val, ok := getWrappingKeyGetAlgorithmAttributeTypeOk(o.Algorithm); ok {
|
||||
toSerialize["Algorithm"] = val
|
||||
}
|
||||
if val, ok := getWrappingKeyGetBackendAttributeTypeOk(o.Backend); ok {
|
||||
toSerialize["Backend"] = val
|
||||
}
|
||||
if val, ok := getWrappingKeyGetCreatedAtAttributeTypeOk(o.CreatedAt); ok {
|
||||
toSerialize["CreatedAt"] = val
|
||||
}
|
||||
if val, ok := getWrappingKeyGetDescriptionAttributeTypeOk(o.Description); ok {
|
||||
toSerialize["Description"] = val
|
||||
}
|
||||
if val, ok := getWrappingKeyGetDisplayNameAttributeTypeOk(o.DisplayName); ok {
|
||||
toSerialize["DisplayName"] = val
|
||||
}
|
||||
if val, ok := getWrappingKeyGetExpiresAtAttributeTypeOk(o.ExpiresAt); ok {
|
||||
toSerialize["ExpiresAt"] = val
|
||||
}
|
||||
if val, ok := getWrappingKeyGetIdAttributeTypeOk(o.Id); ok {
|
||||
toSerialize["Id"] = val
|
||||
}
|
||||
if val, ok := getWrappingKeyGetKeyRingIdAttributeTypeOk(o.KeyRingId); ok {
|
||||
toSerialize["KeyRingId"] = val
|
||||
}
|
||||
if val, ok := getWrappingKeyGetProtectionAttributeTypeOk(o.Protection); ok {
|
||||
toSerialize["Protection"] = val
|
||||
}
|
||||
if val, ok := getWrappingKeyGetPublicKeyAttributeTypeOk(o.PublicKey); ok {
|
||||
toSerialize["PublicKey"] = val
|
||||
}
|
||||
if val, ok := getWrappingKeyGetPurposeAttributeTypeOk(o.Purpose); ok {
|
||||
toSerialize["Purpose"] = val
|
||||
}
|
||||
if val, ok := getWrappingKeyGetStateAttributeTypeOk(o.State); ok {
|
||||
toSerialize["State"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableWrappingKey struct {
|
||||
value *WrappingKey
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableWrappingKey) Get() *WrappingKey {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableWrappingKey) Set(val *WrappingKey) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableWrappingKey) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableWrappingKey) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableWrappingKey(val *WrappingKey) *NullableWrappingKey {
|
||||
return &NullableWrappingKey{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableWrappingKey) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableWrappingKey) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
125
pkg/kmsbeta/model_wrapping_key_list.go
Normal file
125
pkg/kmsbeta/model_wrapping_key_list.go
Normal file
|
|
@ -0,0 +1,125 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the WrappingKeyList type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &WrappingKeyList{}
|
||||
|
||||
/*
|
||||
types and functions for wrappingKeys
|
||||
*/
|
||||
|
||||
// isArray
|
||||
type WrappingKeyListGetWrappingKeysAttributeType = *[]WrappingKey
|
||||
type WrappingKeyListGetWrappingKeysArgType = []WrappingKey
|
||||
type WrappingKeyListGetWrappingKeysRetType = []WrappingKey
|
||||
|
||||
func getWrappingKeyListGetWrappingKeysAttributeTypeOk(arg WrappingKeyListGetWrappingKeysAttributeType) (ret WrappingKeyListGetWrappingKeysRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setWrappingKeyListGetWrappingKeysAttributeType(arg *WrappingKeyListGetWrappingKeysAttributeType, val WrappingKeyListGetWrappingKeysRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
// WrappingKeyList struct for WrappingKeyList
|
||||
type WrappingKeyList struct {
|
||||
// REQUIRED
|
||||
WrappingKeys WrappingKeyListGetWrappingKeysAttributeType `json:"wrappingKeys" required:"true"`
|
||||
}
|
||||
|
||||
type _WrappingKeyList WrappingKeyList
|
||||
|
||||
// NewWrappingKeyList instantiates a new WrappingKeyList 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 NewWrappingKeyList(wrappingKeys WrappingKeyListGetWrappingKeysArgType) *WrappingKeyList {
|
||||
this := WrappingKeyList{}
|
||||
setWrappingKeyListGetWrappingKeysAttributeType(&this.WrappingKeys, wrappingKeys)
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewWrappingKeyListWithDefaults instantiates a new WrappingKeyList 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 NewWrappingKeyListWithDefaults() *WrappingKeyList {
|
||||
this := WrappingKeyList{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetWrappingKeys returns the WrappingKeys field value
|
||||
func (o *WrappingKeyList) GetWrappingKeys() (ret WrappingKeyListGetWrappingKeysRetType) {
|
||||
ret, _ = o.GetWrappingKeysOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetWrappingKeysOk returns a tuple with the WrappingKeys field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *WrappingKeyList) GetWrappingKeysOk() (ret WrappingKeyListGetWrappingKeysRetType, ok bool) {
|
||||
return getWrappingKeyListGetWrappingKeysAttributeTypeOk(o.WrappingKeys)
|
||||
}
|
||||
|
||||
// SetWrappingKeys sets field value
|
||||
func (o *WrappingKeyList) SetWrappingKeys(v WrappingKeyListGetWrappingKeysRetType) {
|
||||
setWrappingKeyListGetWrappingKeysAttributeType(&o.WrappingKeys, v)
|
||||
}
|
||||
|
||||
func (o WrappingKeyList) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getWrappingKeyListGetWrappingKeysAttributeTypeOk(o.WrappingKeys); ok {
|
||||
toSerialize["WrappingKeys"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableWrappingKeyList struct {
|
||||
value *WrappingKeyList
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableWrappingKeyList) Get() *WrappingKeyList {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableWrappingKeyList) Set(val *WrappingKeyList) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableWrappingKeyList) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableWrappingKeyList) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableWrappingKeyList(val *WrappingKeyList) *NullableWrappingKeyList {
|
||||
return &NullableWrappingKeyList{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableWrappingKeyList) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableWrappingKeyList) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
11
pkg/kmsbeta/model_wrapping_key_list_test.go
Normal file
11
pkg/kmsbeta/model_wrapping_key_list_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
79
pkg/kmsbeta/model_wrapping_key_test.go
Normal file
79
pkg/kmsbeta/model_wrapping_key_test.go
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
// isEnum
|
||||
|
||||
func TestWrappingKeyState_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(`"active"`),
|
||||
},
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: `success - possible enum value no. 2`,
|
||||
args: args{
|
||||
src: []byte(`"creating"`),
|
||||
},
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: `success - possible enum value no. 3`,
|
||||
args: args{
|
||||
src: []byte(`"expired"`),
|
||||
},
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: `success - possible enum value no. 4`,
|
||||
args: args{
|
||||
src: []byte(`"deleted"`),
|
||||
},
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: `success - possible enum value no. 5`,
|
||||
args: args{
|
||||
src: []byte(`"key_material_unavailable"`),
|
||||
},
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: "fail",
|
||||
args: args{
|
||||
src: []byte("\"FOOBAR\""),
|
||||
},
|
||||
wantErr: true,
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
v := WrappingKeyState("")
|
||||
if err := v.UnmarshalJSON(tt.args.src); (err != nil) != tt.wantErr {
|
||||
t.Errorf("UnmarshalJSON() error = %v, wantErr %v", err, tt.wantErr)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
115
pkg/kmsbeta/model_wrapping_purpose.go
Normal file
115
pkg/kmsbeta/model_wrapping_purpose.go
Normal file
|
|
@ -0,0 +1,115 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// WrappingPurpose The wrapping purpose for the wrapping key.
|
||||
type WrappingPurpose string
|
||||
|
||||
// List of wrappingPurpose
|
||||
const (
|
||||
WRAPPINGPURPOSE_SYMMETRIC_KEY WrappingPurpose = "wrap_symmetric_key"
|
||||
WRAPPINGPURPOSE_ASYMMETRIC_KEY WrappingPurpose = "wrap_asymmetric_key"
|
||||
)
|
||||
|
||||
// All allowed values of WrappingPurpose enum
|
||||
var AllowedWrappingPurposeEnumValues = []WrappingPurpose{
|
||||
"wrap_symmetric_key",
|
||||
"wrap_asymmetric_key",
|
||||
}
|
||||
|
||||
func (v *WrappingPurpose) 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 := WrappingPurpose(value)
|
||||
for _, existing := range AllowedWrappingPurposeEnumValues {
|
||||
if existing == enumTypeValue {
|
||||
*v = enumTypeValue
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
return fmt.Errorf("%+v is not a valid WrappingPurpose", value)
|
||||
}
|
||||
|
||||
// NewWrappingPurposeFromValue returns a pointer to a valid WrappingPurpose
|
||||
// for the value passed as argument, or an error if the value passed is not allowed by the enum
|
||||
func NewWrappingPurposeFromValue(v string) (*WrappingPurpose, error) {
|
||||
ev := WrappingPurpose(v)
|
||||
if ev.IsValid() {
|
||||
return &ev, nil
|
||||
} else {
|
||||
return nil, fmt.Errorf("invalid value '%v' for WrappingPurpose: valid values are %v", v, AllowedWrappingPurposeEnumValues)
|
||||
}
|
||||
}
|
||||
|
||||
// IsValid return true if the value is valid for the enum, false otherwise
|
||||
func (v WrappingPurpose) IsValid() bool {
|
||||
for _, existing := range AllowedWrappingPurposeEnumValues {
|
||||
if existing == v {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// Ptr returns reference to wrappingPurpose value
|
||||
func (v WrappingPurpose) Ptr() *WrappingPurpose {
|
||||
return &v
|
||||
}
|
||||
|
||||
type NullableWrappingPurpose struct {
|
||||
value *WrappingPurpose
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableWrappingPurpose) Get() *WrappingPurpose {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableWrappingPurpose) Set(val *WrappingPurpose) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableWrappingPurpose) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableWrappingPurpose) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableWrappingPurpose(val *WrappingPurpose) *NullableWrappingPurpose {
|
||||
return &NullableWrappingPurpose{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableWrappingPurpose) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableWrappingPurpose) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
11
pkg/kmsbeta/model_wrapping_purpose_test.go
Normal file
11
pkg/kmsbeta/model_wrapping_purpose_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
385
pkg/kmsbeta/utils.go
Normal file
385
pkg/kmsbeta/utils.go
Normal file
|
|
@ -0,0 +1,385 @@
|
|||
/*
|
||||
STACKIT Key Management Service API
|
||||
|
||||
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
||||
|
||||
API version: 1beta.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package kmsbeta
|
||||
|
||||
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)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue