terraform-provider-stackitp.../pkg/intakebeta/model_intake_user_response.go
2026-01-21 09:07:29 +01:00

603 lines
20 KiB
Go

/*
STACKIT Intake API
This API provides endpoints for managing Intakes.
API version: 1beta.3.5
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package intakebeta
import (
"encoding/json"
"fmt"
"time"
)
// checks if the IntakeUserResponse type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &IntakeUserResponse{}
/*
types and functions for clientConfig
*/
// isModel
type IntakeUserResponseGetClientConfigAttributeType = *ClientConfig
type IntakeUserResponseGetClientConfigArgType = ClientConfig
type IntakeUserResponseGetClientConfigRetType = ClientConfig
func getIntakeUserResponseGetClientConfigAttributeTypeOk(arg IntakeUserResponseGetClientConfigAttributeType) (ret IntakeUserResponseGetClientConfigRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setIntakeUserResponseGetClientConfigAttributeType(arg *IntakeUserResponseGetClientConfigAttributeType, val IntakeUserResponseGetClientConfigRetType) {
*arg = &val
}
/*
types and functions for create_time
*/
// isDateTime
type IntakeUserResponseGetCreateTimeAttributeType = *time.Time
type IntakeUserResponseGetCreateTimeArgType = time.Time
type IntakeUserResponseGetCreateTimeRetType = time.Time
func getIntakeUserResponseGetCreateTimeAttributeTypeOk(arg IntakeUserResponseGetCreateTimeAttributeType) (ret IntakeUserResponseGetCreateTimeRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setIntakeUserResponseGetCreateTimeAttributeType(arg *IntakeUserResponseGetCreateTimeAttributeType, val IntakeUserResponseGetCreateTimeRetType) {
*arg = &val
}
/*
types and functions for description
*/
// isNotNullableString
type IntakeUserResponseGetDescriptionAttributeType = *string
func getIntakeUserResponseGetDescriptionAttributeTypeOk(arg IntakeUserResponseGetDescriptionAttributeType) (ret IntakeUserResponseGetDescriptionRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setIntakeUserResponseGetDescriptionAttributeType(arg *IntakeUserResponseGetDescriptionAttributeType, val IntakeUserResponseGetDescriptionRetType) {
*arg = &val
}
type IntakeUserResponseGetDescriptionArgType = string
type IntakeUserResponseGetDescriptionRetType = string
/*
types and functions for displayName
*/
// isNotNullableString
type IntakeUserResponseGetDisplayNameAttributeType = *string
func getIntakeUserResponseGetDisplayNameAttributeTypeOk(arg IntakeUserResponseGetDisplayNameAttributeType) (ret IntakeUserResponseGetDisplayNameRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setIntakeUserResponseGetDisplayNameAttributeType(arg *IntakeUserResponseGetDisplayNameAttributeType, val IntakeUserResponseGetDisplayNameRetType) {
*arg = &val
}
type IntakeUserResponseGetDisplayNameArgType = string
type IntakeUserResponseGetDisplayNameRetType = string
/*
types and functions for id
*/
// isNotNullableString
type IntakeUserResponseGetIdAttributeType = *string
func getIntakeUserResponseGetIdAttributeTypeOk(arg IntakeUserResponseGetIdAttributeType) (ret IntakeUserResponseGetIdRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setIntakeUserResponseGetIdAttributeType(arg *IntakeUserResponseGetIdAttributeType, val IntakeUserResponseGetIdRetType) {
*arg = &val
}
type IntakeUserResponseGetIdArgType = string
type IntakeUserResponseGetIdRetType = string
/*
types and functions for labels
*/
// isContainer
type IntakeUserResponseGetLabelsAttributeType = *map[string]string
type IntakeUserResponseGetLabelsArgType = *map[string]string
type IntakeUserResponseGetLabelsRetType = *map[string]string
func getIntakeUserResponseGetLabelsAttributeTypeOk(arg IntakeUserResponseGetLabelsAttributeType) (ret IntakeUserResponseGetLabelsRetType, ok bool) {
if arg == nil {
return nil, false
}
return arg, true
}
func setIntakeUserResponseGetLabelsAttributeType(arg *IntakeUserResponseGetLabelsAttributeType, val IntakeUserResponseGetLabelsRetType) {
*arg = val
}
/*
types and functions for state
*/
// isEnum
// IntakeUserResponseState The current state of the resource.
// value type for enums
type IntakeUserResponseState string
// List of State
const (
INTAKEUSERRESPONSESTATE_RECONCILING IntakeUserResponseState = "reconciling"
INTAKEUSERRESPONSESTATE_ACTIVE IntakeUserResponseState = "active"
INTAKEUSERRESPONSESTATE_DELETING IntakeUserResponseState = "deleting"
)
// All allowed values of IntakeUserResponse enum
var AllowedIntakeUserResponseStateEnumValues = []IntakeUserResponseState{
"reconciling",
"active",
"deleting",
}
func (v *IntakeUserResponseState) UnmarshalJSON(src []byte) error {
// use a type alias to prevent infinite recursion during unmarshal,
// see https://biscuit.ninja/posts/go-avoid-an-infitine-loop-with-custom-json-unmarshallers
type TmpJson IntakeUserResponseState
var value TmpJson
err := json.Unmarshal(src, &value)
if err != nil {
return err
}
// Allow unmarshalling zero value for testing purposes
var zeroValue TmpJson
if value == zeroValue {
return nil
}
enumTypeValue := IntakeUserResponseState(value)
for _, existing := range AllowedIntakeUserResponseStateEnumValues {
if existing == enumTypeValue {
*v = enumTypeValue
return nil
}
}
return fmt.Errorf("%+v is not a valid IntakeUserResponse", value)
}
// NewIntakeUserResponseStateFromValue returns a pointer to a valid IntakeUserResponseState
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewIntakeUserResponseStateFromValue(v IntakeUserResponseState) (*IntakeUserResponseState, error) {
ev := IntakeUserResponseState(v)
if ev.IsValid() {
return &ev, nil
} else {
return nil, fmt.Errorf("invalid value '%v' for IntakeUserResponseState: valid values are %v", v, AllowedIntakeUserResponseStateEnumValues)
}
}
// IsValid return true if the value is valid for the enum, false otherwise
func (v IntakeUserResponseState) IsValid() bool {
for _, existing := range AllowedIntakeUserResponseStateEnumValues {
if existing == v {
return true
}
}
return false
}
// Ptr returns reference to StateState value
func (v IntakeUserResponseState) Ptr() *IntakeUserResponseState {
return &v
}
type NullableIntakeUserResponseState struct {
value *IntakeUserResponseState
isSet bool
}
func (v NullableIntakeUserResponseState) Get() *IntakeUserResponseState {
return v.value
}
func (v *NullableIntakeUserResponseState) Set(val *IntakeUserResponseState) {
v.value = val
v.isSet = true
}
func (v NullableIntakeUserResponseState) IsSet() bool {
return v.isSet
}
func (v *NullableIntakeUserResponseState) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableIntakeUserResponseState(val *IntakeUserResponseState) *NullableIntakeUserResponseState {
return &NullableIntakeUserResponseState{value: val, isSet: true}
}
func (v NullableIntakeUserResponseState) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableIntakeUserResponseState) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
type IntakeUserResponseGetStateAttributeType = *IntakeUserResponseState
type IntakeUserResponseGetStateArgType = IntakeUserResponseState
type IntakeUserResponseGetStateRetType = IntakeUserResponseState
func getIntakeUserResponseGetStateAttributeTypeOk(arg IntakeUserResponseGetStateAttributeType) (ret IntakeUserResponseGetStateRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setIntakeUserResponseGetStateAttributeType(arg *IntakeUserResponseGetStateAttributeType, val IntakeUserResponseGetStateRetType) {
*arg = &val
}
/*
types and functions for type
*/
// isEnumRef
type IntakeUserResponseGetTypeAttributeType = *UserType
type IntakeUserResponseGetTypeArgType = UserType
type IntakeUserResponseGetTypeRetType = UserType
func getIntakeUserResponseGetTypeAttributeTypeOk(arg IntakeUserResponseGetTypeAttributeType) (ret IntakeUserResponseGetTypeRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setIntakeUserResponseGetTypeAttributeType(arg *IntakeUserResponseGetTypeAttributeType, val IntakeUserResponseGetTypeRetType) {
*arg = &val
}
/*
types and functions for user
*/
// isNotNullableString
type IntakeUserResponseGetUserAttributeType = *string
func getIntakeUserResponseGetUserAttributeTypeOk(arg IntakeUserResponseGetUserAttributeType) (ret IntakeUserResponseGetUserRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setIntakeUserResponseGetUserAttributeType(arg *IntakeUserResponseGetUserAttributeType, val IntakeUserResponseGetUserRetType) {
*arg = &val
}
type IntakeUserResponseGetUserArgType = string
type IntakeUserResponseGetUserRetType = string
// IntakeUserResponse struct for IntakeUserResponse
type IntakeUserResponse struct {
ClientConfig IntakeUserResponseGetClientConfigAttributeType `json:"clientConfig,omitempty"`
// The point in time the resource was created.
// REQUIRED
CreateTime IntakeUserResponseGetCreateTimeAttributeType `json:"create_time" required:"true"`
// The description is a longer text chosen by the user to provide more context for the resource.
Description IntakeUserResponseGetDescriptionAttributeType `json:"description,omitempty"`
// The display name is a short name chosen by the user to identify the resource.
// REQUIRED
DisplayName IntakeUserResponseGetDisplayNameAttributeType `json:"displayName" required:"true"`
// A auto generated unique id which identifies the resource.
// REQUIRED
Id IntakeUserResponseGetIdAttributeType `json:"id" required:"true"`
// Labels are a set of key-value pairs assigned to resources.
Labels IntakeUserResponseGetLabelsAttributeType `json:"labels,omitempty"`
// The current state of the resource.
// REQUIRED
State IntakeUserResponseGetStateAttributeType `json:"state" required:"true"`
// REQUIRED
Type IntakeUserResponseGetTypeAttributeType `json:"type" required:"true"`
// The user to connect to the intake.
// REQUIRED
User IntakeUserResponseGetUserAttributeType `json:"user" required:"true"`
}
type _IntakeUserResponse IntakeUserResponse
// NewIntakeUserResponse instantiates a new IntakeUserResponse object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewIntakeUserResponse(createTime IntakeUserResponseGetCreateTimeArgType, displayName IntakeUserResponseGetDisplayNameArgType, id IntakeUserResponseGetIdArgType, state IntakeUserResponseGetStateArgType, types IntakeUserResponseGetTypeArgType, user IntakeUserResponseGetUserArgType) *IntakeUserResponse {
this := IntakeUserResponse{}
setIntakeUserResponseGetCreateTimeAttributeType(&this.CreateTime, createTime)
setIntakeUserResponseGetDisplayNameAttributeType(&this.DisplayName, displayName)
setIntakeUserResponseGetIdAttributeType(&this.Id, id)
setIntakeUserResponseGetStateAttributeType(&this.State, state)
setIntakeUserResponseGetTypeAttributeType(&this.Type, types)
setIntakeUserResponseGetUserAttributeType(&this.User, user)
return &this
}
// NewIntakeUserResponseWithDefaults instantiates a new IntakeUserResponse object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewIntakeUserResponseWithDefaults() *IntakeUserResponse {
this := IntakeUserResponse{}
var types UserType = USERTYPE_INTAKE
this.Type = &types
return &this
}
// GetClientConfig returns the ClientConfig field value if set, zero value otherwise.
func (o *IntakeUserResponse) GetClientConfig() (res IntakeUserResponseGetClientConfigRetType) {
res, _ = o.GetClientConfigOk()
return
}
// GetClientConfigOk returns a tuple with the ClientConfig field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IntakeUserResponse) GetClientConfigOk() (ret IntakeUserResponseGetClientConfigRetType, ok bool) {
return getIntakeUserResponseGetClientConfigAttributeTypeOk(o.ClientConfig)
}
// HasClientConfig returns a boolean if a field has been set.
func (o *IntakeUserResponse) HasClientConfig() bool {
_, ok := o.GetClientConfigOk()
return ok
}
// SetClientConfig gets a reference to the given ClientConfig and assigns it to the ClientConfig field.
func (o *IntakeUserResponse) SetClientConfig(v IntakeUserResponseGetClientConfigRetType) {
setIntakeUserResponseGetClientConfigAttributeType(&o.ClientConfig, v)
}
// GetCreateTime returns the CreateTime field value
func (o *IntakeUserResponse) GetCreateTime() (ret IntakeUserResponseGetCreateTimeRetType) {
ret, _ = o.GetCreateTimeOk()
return ret
}
// GetCreateTimeOk returns a tuple with the CreateTime field value
// and a boolean to check if the value has been set.
func (o *IntakeUserResponse) GetCreateTimeOk() (ret IntakeUserResponseGetCreateTimeRetType, ok bool) {
return getIntakeUserResponseGetCreateTimeAttributeTypeOk(o.CreateTime)
}
// SetCreateTime sets field value
func (o *IntakeUserResponse) SetCreateTime(v IntakeUserResponseGetCreateTimeRetType) {
setIntakeUserResponseGetCreateTimeAttributeType(&o.CreateTime, v)
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *IntakeUserResponse) GetDescription() (res IntakeUserResponseGetDescriptionRetType) {
res, _ = o.GetDescriptionOk()
return
}
// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IntakeUserResponse) GetDescriptionOk() (ret IntakeUserResponseGetDescriptionRetType, ok bool) {
return getIntakeUserResponseGetDescriptionAttributeTypeOk(o.Description)
}
// HasDescription returns a boolean if a field has been set.
func (o *IntakeUserResponse) HasDescription() bool {
_, ok := o.GetDescriptionOk()
return ok
}
// SetDescription gets a reference to the given string and assigns it to the Description field.
func (o *IntakeUserResponse) SetDescription(v IntakeUserResponseGetDescriptionRetType) {
setIntakeUserResponseGetDescriptionAttributeType(&o.Description, v)
}
// GetDisplayName returns the DisplayName field value
func (o *IntakeUserResponse) GetDisplayName() (ret IntakeUserResponseGetDisplayNameRetType) {
ret, _ = o.GetDisplayNameOk()
return ret
}
// GetDisplayNameOk returns a tuple with the DisplayName field value
// and a boolean to check if the value has been set.
func (o *IntakeUserResponse) GetDisplayNameOk() (ret IntakeUserResponseGetDisplayNameRetType, ok bool) {
return getIntakeUserResponseGetDisplayNameAttributeTypeOk(o.DisplayName)
}
// SetDisplayName sets field value
func (o *IntakeUserResponse) SetDisplayName(v IntakeUserResponseGetDisplayNameRetType) {
setIntakeUserResponseGetDisplayNameAttributeType(&o.DisplayName, v)
}
// GetId returns the Id field value
func (o *IntakeUserResponse) GetId() (ret IntakeUserResponseGetIdRetType) {
ret, _ = o.GetIdOk()
return ret
}
// GetIdOk returns a tuple with the Id field value
// and a boolean to check if the value has been set.
func (o *IntakeUserResponse) GetIdOk() (ret IntakeUserResponseGetIdRetType, ok bool) {
return getIntakeUserResponseGetIdAttributeTypeOk(o.Id)
}
// SetId sets field value
func (o *IntakeUserResponse) SetId(v IntakeUserResponseGetIdRetType) {
setIntakeUserResponseGetIdAttributeType(&o.Id, v)
}
// GetLabels returns the Labels field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *IntakeUserResponse) GetLabels() (res IntakeUserResponseGetLabelsRetType) {
res, _ = o.GetLabelsOk()
return
}
// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *IntakeUserResponse) GetLabelsOk() (ret IntakeUserResponseGetLabelsRetType, ok bool) {
return getIntakeUserResponseGetLabelsAttributeTypeOk(o.Labels)
}
// HasLabels returns a boolean if a field has been set.
func (o *IntakeUserResponse) HasLabels() bool {
_, ok := o.GetLabelsOk()
return ok
}
// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field.
func (o *IntakeUserResponse) SetLabels(v IntakeUserResponseGetLabelsRetType) {
setIntakeUserResponseGetLabelsAttributeType(&o.Labels, v)
}
// GetState returns the State field value
func (o *IntakeUserResponse) GetState() (ret IntakeUserResponseGetStateRetType) {
ret, _ = o.GetStateOk()
return ret
}
// GetStateOk returns a tuple with the State field value
// and a boolean to check if the value has been set.
func (o *IntakeUserResponse) GetStateOk() (ret IntakeUserResponseGetStateRetType, ok bool) {
return getIntakeUserResponseGetStateAttributeTypeOk(o.State)
}
// SetState sets field value
func (o *IntakeUserResponse) SetState(v IntakeUserResponseGetStateRetType) {
setIntakeUserResponseGetStateAttributeType(&o.State, v)
}
// GetType returns the Type field value
func (o *IntakeUserResponse) GetType() (ret IntakeUserResponseGetTypeRetType) {
ret, _ = o.GetTypeOk()
return ret
}
// GetTypeOk returns a tuple with the Type field value
// and a boolean to check if the value has been set.
func (o *IntakeUserResponse) GetTypeOk() (ret IntakeUserResponseGetTypeRetType, ok bool) {
return getIntakeUserResponseGetTypeAttributeTypeOk(o.Type)
}
// SetType sets field value
func (o *IntakeUserResponse) SetType(v IntakeUserResponseGetTypeRetType) {
setIntakeUserResponseGetTypeAttributeType(&o.Type, v)
}
// GetUser returns the User field value
func (o *IntakeUserResponse) GetUser() (ret IntakeUserResponseGetUserRetType) {
ret, _ = o.GetUserOk()
return ret
}
// GetUserOk returns a tuple with the User field value
// and a boolean to check if the value has been set.
func (o *IntakeUserResponse) GetUserOk() (ret IntakeUserResponseGetUserRetType, ok bool) {
return getIntakeUserResponseGetUserAttributeTypeOk(o.User)
}
// SetUser sets field value
func (o *IntakeUserResponse) SetUser(v IntakeUserResponseGetUserRetType) {
setIntakeUserResponseGetUserAttributeType(&o.User, v)
}
func (o IntakeUserResponse) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getIntakeUserResponseGetClientConfigAttributeTypeOk(o.ClientConfig); ok {
toSerialize["ClientConfig"] = val
}
if val, ok := getIntakeUserResponseGetCreateTimeAttributeTypeOk(o.CreateTime); ok {
toSerialize["CreateTime"] = val
}
if val, ok := getIntakeUserResponseGetDescriptionAttributeTypeOk(o.Description); ok {
toSerialize["Description"] = val
}
if val, ok := getIntakeUserResponseGetDisplayNameAttributeTypeOk(o.DisplayName); ok {
toSerialize["DisplayName"] = val
}
if val, ok := getIntakeUserResponseGetIdAttributeTypeOk(o.Id); ok {
toSerialize["Id"] = val
}
if val, ok := getIntakeUserResponseGetLabelsAttributeTypeOk(o.Labels); ok {
toSerialize["Labels"] = val
}
if val, ok := getIntakeUserResponseGetStateAttributeTypeOk(o.State); ok {
toSerialize["State"] = val
}
if val, ok := getIntakeUserResponseGetTypeAttributeTypeOk(o.Type); ok {
toSerialize["Type"] = val
}
if val, ok := getIntakeUserResponseGetUserAttributeTypeOk(o.User); ok {
toSerialize["User"] = val
}
return toSerialize, nil
}
type NullableIntakeUserResponse struct {
value *IntakeUserResponse
isSet bool
}
func (v NullableIntakeUserResponse) Get() *IntakeUserResponse {
return v.value
}
func (v *NullableIntakeUserResponse) Set(val *IntakeUserResponse) {
v.value = val
v.isSet = true
}
func (v NullableIntakeUserResponse) IsSet() bool {
return v.isSet
}
func (v *NullableIntakeUserResponse) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableIntakeUserResponse(val *IntakeUserResponse) *NullableIntakeUserResponse {
return &NullableIntakeUserResponse{value: val, isSet: true}
}
func (v NullableIntakeUserResponse) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableIntakeUserResponse) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}